swim icon indicating copy to clipboard operation
swim copied to clipboard

Stop method on client terminates commands

Open DobromirM opened this issue 6 years ago • 1 comments

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.

DobromirM avatar Sep 27 '19 17:09 DobromirM

Same behavior is seen for set(...) on ValueDownLink

msche avatar Feb 03 '20 07:02 msche