EastEriq / LAST_Messaging

Messaging framework for the LAST project
0 stars 0 forks source link

Messenger query output printed in the receiving session, instead of being squelched, if processed too late #7

Open EastEriq opened 1 month ago

EastEriq commented 1 month ago

Associated to https://github.com/PolishookDavid/LAST_OCS/issues/26.

Not reproducing it with:

p=obs.util.SpawnedMatlab;
p.spawn
p.connect
p.Messenger.send('a=3;pause(10)'); p.Responder.query('a;'), p.Responder.query('a;')

or variations

EastEriq commented 1 month ago

Reproducing like this:

M=obs.util.Message('Unit.Focuser{2}.classCommand(''Status'');');M.RequestReplyWithin=0.005
Unit.Slave(2).Responder.query(M)

produces

>> ans =
    'idle'

in the Slave(2) xterm session. Note classCommand('Status'); and not classCommand('Status;'). However, if more time is given, there is no echo.

>> M=obs.util.Message('Unit.Focuser{2}.classCommand(''Status'');');M.RequestReplyWithin=0.5;
>> Unit.Slave(2).Responder.query(M)
ans =
    'idle'

and no echo in the Slave.

EastEriq commented 1 month ago

And this is quite likely because of classCommand.

>> M=obs.util.Message('Unit.Focuser{2}');M.RequestReplyWithin=0.005;
>> Unit.Slave(2).Responder.query(M)

gives no echo in slave. classCommand has eval at its lines 84 and 86.

EastEriq commented 1 month ago

Root cause, likely:

>> evalin('base','eval(''a=1'');');
a =
     1
EastEriq commented 1 month ago

Can't really come up with a complete understanding and a solution, but since in general I want classCommand() without a semicolon inside to produce echo in the receiver, and since the only nuisance so far is https://github.com/PolishookDavid/LAST_OCS/issues/26, which can be worked around by changing the queries from the SuperUnitMonitor (commit https://github.com/EastEriq/LAST_SuperunitMonitoring/commit/5dff450842ff44750eeaa5a5916798a29a92c49e), I'll leave things as they are, for now.