Gordon Sim wrote:
Alan Conway wrote:
We need to re-open the discussion on this. Currently a session is
either entirely sync or entirely async so your choices are safe but
slow or fast but risky.
Note you can change the mode between commands. So you can have it in
synchronous mode when performing any setup, then switch to async mode
when you wish to send lots of messages.
I've had user feedback that an intermediate mode which is sync for
most operations (declare, bind, subscribe etc.) but async for message
transfer. With this as the default, most applications would Just Work
without surprises and with good performance.
My feeling is we need to address this, but I know the above idea is
controversial - what do people think?
I've never been keen on this idea, but I can see the attraction and
wouldn't be opposed.
Another option would be to ditch the sync/async modes for session and
make it an explicit part of function names, so you'd have synchronous
declare(...) and asynchronous asyncDeclare(...). All our docs &
examples would use declare(), bind(), subscribe() etc. and
asyncTransfer(...) so things will Just Work for users that follow the
examples.
I really don't like having separate methods. Having an (optional?)
argument per method that indicated whether it was sync or not would in
my view be nicer.
How about an async parameter defaulting to false? We would update the examples
to show session.transfer(async=true, ...) but leave the rest defaulting to sync.