links for 2011-06-07

June 8, 2011
  • <blockquote>
    <pre>
    >>> import kenosis
    >>> n = kenosis.Node(bootstrapNetAddress=None)
    >>> n.port()5005
    >>> n2 = kenosis.Node(bootstrapNetAddress=None)
    >>> n2.bootstrap("localhost:%s" % n.port())
    >>> n2.port()5006
    >>> n2.rpc(nodeAddress=n.nodeAddress()).kenosis.ping()
    address.NodeAddress(numericAddress=0x11fe53239e10f6c7b21d9a9aaf37a2f37cc34abe)
    >>> class Handler:
    …     def returnInt(self, arg):
    …         return int(arg)

    >>> n.registerNamedHandler(name="test", handler=Handler())
    >>> n2.rpc(nodeAddress=n.nodeAddress()).test.returnInt(42)42
    >>> n2.rpc(nodeAddress=n.nodeAddress()).test.returnInt(1234321)1234321
    >>> n.rpc(nodeAddress=n2.nodeAddress()).kenosis.ping()
    address.NodeAddress(numericAddress=0x8b6eb0433be6a2751493ef39ac5a7236182e20b3)
    </pre></blockquote>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: