@@ -14,37 +14,37 @@ class CounterSink(IObjectSink):
1414 def __init__ (self ):
1515 # register sink with client node
1616 self .client = ClientNode .register_sink (self )
17- print (' client' , self .client )
17+ print (" client" , self .client )
1818
1919 def increment (self ):
2020 # remote call the increment method
2121 if self .client :
22- self .client .invoke_remote (' demo.Counter/increment' , [], None )
22+ self .client .invoke_remote (" demo.Counter/increment" , [], None )
2323
2424 def olink_object_name (self ):
2525 # return the name of the sink
26- return ' demo.Counter'
26+ return " demo.Counter"
2727
2828 def olink_on_signal (self , name : str , args : list [Any ]):
2929 # handle the incoming signal from the remote source
3030 path = Name .path_from_name (name )
31- print (' on signal: %s: %s' % (path , args ))
31+ print (" on signal: %s: %s" % (path , args ))
3232
3333 def olink_on_property_changed (self , name : str , value : Any ) -> None :
3434 # handle the property change from the remote source
3535 path = Name .path_from_name (name )
36- print (' on property changed: %s: %s' % (path , value ))
36+ print (" on property changed: %s: %s" % (path , value ))
3737
3838 def olink_on_init (self , name : str , props : object , node : ClientNode ):
3939 # handle the initialization of the sink,
4040 # called when the sink is linked to remote source
41- print (' on init: %s: %s' % (name , props ))
41+ print (" on init: %s: %s" % (name , props ))
4242 self .client = node
4343
4444 def olink_on_release (self ):
4545 # handle the release of the sink,
4646 # called when the sink is unlinked from remote source
47- print (' on release' )
47+ print (" on release" )
4848
4949
5050class ClientWebsocketAdapter :
@@ -59,7 +59,7 @@ def __init__(self, node):
5959
6060 def writer (self , data ):
6161 # don't send directly, first write to queue
62- print (' write to queue' )
62+ print (" write to queue" )
6363 self .queue .put_nowait (data )
6464
6565 async def _reader (self , ws ):
@@ -86,20 +86,20 @@ async def connect(self, address: str):
8686 await asyncio .gather (sender_task , reader_task )
8787 await self .queue .join ()
8888 except Exception as e :
89- print (' exception while connecting: ' , e )
89+ print (" exception while connecting: " , e )
9090
9191
92- address = ' ws://localhost:8282/ws'
92+ address = " ws://localhost:8282/ws"
9393# create a client node for ObjectLink registry and protocol
9494node = ClientNode ()
9595# link the node to the service name
96- node .link_node (' demo.Counter' )
96+ node .link_node (" demo.Counter" )
9797
9898# create a ws client which handles the ws adapter
9999client = ClientWebsocketAdapter (node )
100100
101101counter = CounterSink ()
102- node .link_remote (' demo.Counter' )
102+ node .link_remote (" demo.Counter" )
103103counter .increment ()
104104
105105
0 commit comments