Asynchronous calls on a TROSynapseSuperHTTPChannel are not working

Some of the problems:

  • The AnswerReceivedEvent never gets set
  • The Busy flag is always false
  • There is no exception handling or error handling possible (an async exception is never raised)
  • There is no way of telling when a call failed (except by implementing your own timeout mechanism)

See sample application

Hello,

Thanks for the report. Confirming the first two issues, logged accordingly:
55611: Delphi async requests: AsyncProxy.AnswerReceivedEvent is never set when using Superchannel
55612: Delphi async requests: AsyncProxy.Busy is never set when using Superchannel
Others are need to be retested after those two fixed. Logged anyway:
55613: Delphi async requests: channel’s OnAsyncException event is not fired

This requires some time to fix, sorry for the inconvenience. Expect this fixed in one of the future betas.

Best regards - Sergey.

Hello,

Finally investigated it. So:

55611: Delphi async requests: AsyncProxy.AnswerReceivedEvent is never set when using Superchannel - FIXED. You can rely on that synchronization object since the next beta.

55613: Delphi async requests: channel’s OnAsyncException event is not fired
More interesting. This event was not intended to be used to receive server side exceptions. It’s purpose is to report internal errors of async proxy, channel or whatever happens during the request dispatching. To receive server side exceptions sent with the message you need to invoke the corresponding Retrive_%methodname% method. If there is any exception sent to the client it is raised during Retrive_%methodname% execution. But there is a problem: methods defined in the RODL like procedures without out parameters produce no Retrive_%methodname% code. Unfortunately we can’t change this because users may rely on such “fire and forget” behavior of simple procedures. The workaround is quite simple: don’t declare methods supposed to be called asynchronously as procedures, provide any return value (or create wrappers for existing procedural methods).

55612: Delphi async requests: AsyncProxy.Busy is never set when using Superchannel
This is another unfixable flaw of the async requests facility. Actually it reflects the busy state of the channel, superchannels are never busy. Like previous issue, we cannot fix it for backward compatibility reasons. Advised workaround is: don’t use the proxy object for simultaneous requests, create a new proxy for each one and track the completion status with either AnswerReceived property or AnswerReceivedEvent object.

Best regards - Sergey.