Example #1
0
        usage()

if len(args) != 1:
    usage()

service_name = args[0]

# Setup a connection to the local RVI node
rvi = RVI(rvi_node_url)

# Starting the thread that handles incoming calls is
# not really necessary since register_service will do it for us.

rvi.start_serve_thread()

rvi.set_services_available_callback(services_available)
rvi.set_services_unavailable_callback(services_unavailable)

# Register our service  and invoke 'service_invoked' if we
# get an incoming JSON-RPC call to it from the RVI node
#
full_service_name = rvi.register_service(service_name, service_invoked)

print "RVI General Service."
print "RVI node URL:        ", rvi_node_url
print "Service:             ", full_service_name

raw_input('Press enter to quit: ')
rvi.unregister_service(service_name)
rvi.shutdown()
sys.exit(0)
Example #2
0
if len(args) != 1:
    usage()

service_name = args[0]


# Setup a connection to the local RVI node
rvi = RVI(rvi_node_url)

# Starting the thread that handles incoming calls is
# not really necessary since register_service will do it for us.

rvi.start_serve_thread() 

rvi.set_services_available_callback(services_available) 
rvi.set_services_unavailable_callback(services_unavailable) 

# Register our service  and invoke 'service_invoked' if we 
# get an incoming JSON-RPC call to it from the RVI node
#
full_service_name = rvi.register_service(service_name, service_invoked) 


print "RVI General Service."
print "RVI node URL:        ", rvi_node_url
print "Service:             ", full_service_name

raw_input('Press enter to quit: ')
rvi.unregister_service(service_name)
rvi.shutdown()