[SOLVED] run operation asynchronous
Author: m.doorne@amyyon.nl (Doomic)
We have a service component that contains an operation that may take a minute to complete. The other code is not depending on it. so we like to run this async. The operation is activated from another service component that has been activated by an DSP component. (userver proces). Whatever i try, i can't get it working. What i have tried:
activate/async "service".asyncOperation("data")
But this gives a $status of -161 "Illegal mixture of synchronous and asynchronous communication modes" therefor i moved the asycOperation to a new service component (to be sure there doesn't exists an instance of this component)
activate/async "asyncService".asyncOperation("data")
still got a -161
newinstance/async "asyncService", vAsyncService activate/async vAsyncService.asyncOperation("data")
no error when newinstance is called, but still -161 on activate. next i tried to use "Asynchronous Messaging". But found later that this is not posible in an userver proces. If the receiving component is running in the same userver process, the message is converted to a synchronous send message But i leads me to the UTIMER component.
activate "UTIMER".start("00.00.02") activate "UTIMER".setMessage("asyncService", "MessageId001", "data") activate "UTIMER".setRepeat(1)
All activates gives $status 0, but the Asynchronous Interupt trigger in the asyncService is never called. Also tried to place the activates in another order, but this found this order in some documentation, and reordering didn't let it work. Placed a sleep of 400 at the end to make sure the timer sends the message before the webrequest is finished.. not results.. now i am lost. Don't know where to look. Any suggestions? or explanaition why the activate/async is not working?




