This directory contains an example verticle for testing VerStix.
You can send 'hello'
event and send/receive 'echo'
event using VerStix-enabled Smalltalk images.
Through SDKMAN:
sdk install vertx
vertx run TcpEventBusBridgeEchoServer.groovy
Now the verticle is waiting for events.
eventBus := VsEventBus host: 'localhost' port: 7000.
eventBus connect.
eventBus send: {'value'->'HELLO from Smalltalk'} to: 'echo'.
You can see the output on server console
got: {"value":"HELLO from Smalltalk"}
eventBus send: {'value'-> Time now asString} to: 'echo' callback: [:msg | msg body inspect].
If you set a callback, you can receive the answer. Inspector shows the value you sent.
eventBus subscribe: 'echo' callback: [:msg | msg body inspect]. "On various images-A,B,C,D, etc"
eventBus publish: {'value'-> Time now asString} to: 'echo'. "On image-A"
Try subscribing from other Smalltalk images. You can receive the broadcasted events.
eventBus unsubscribe: 'echo'.
eventBus release.