swim
swim copied to clipboard
Stop method on client terminates commands
The Java ClientRuntime has a stop() method. If the method is executed directly after a .command() statement, the command never gets sent.
Example:
ClientRuntime swimClient = new ClientRuntime();
//This does not get sent
swimClient.command(hostUri, thirdRoomUri, "toggleLights", Value.absent());
swimClient.stop();
A workaround is to use Thread.sleep(2000); to add some delay.
Example:
ClientRuntime swimClient = new ClientRuntime();
//Now it works fine
swimClient.command(hostUri, thirdRoomUri, "toggleLights", Value.absent());
Thread.sleep(2000);
swimClient.stop();
I think that the stop() method should make sure that everything has been sent before terminating the connection, or at the very least, it should display a warning that a command has been terminated before being sent.
Same behavior is seen for set(...) on ValueDownLink