cancel
Showing results for 
Search instead for 
Did you mean: 

Thread safety of signalEventReceived vs signalEventReceivedAsync

michalwrobel
Champ on-the-rise
Champ on-the-rise
Shortly speaking :

I need functionality of RuntimeService signalEventReceived(String executionId, Map<String,Object> processVariables) in the asynchronous manner. I wanted to go towards signalEventReceivedAsync, but they don't have a form with setting process variables.

For the sake of experimenting I put every synchronous signalEventReceived call into a new thread but I feel something can go wrong with this attitude.

Questions:
1. Are signalEventReceived methods thread safe, or everything will everything break eventually?
2. Why there is no version signalEventReceivedAsync supporting setting process variables?
Is it only because of no guarantee of not suppressing these variable values by other calls to signalEventReceivedAsync?
Would it be hard to implement async version of signalEventReceived supporting process variables?
Is sequence of delivering signals called using Async method unchanged or is it random?
1 REPLY 1

trademak
Star Contributor
Star Contributor
I think you are referring to a single queue solution, so the order of processing is guaranteed. This is something that's not part of the Activiti core but could be added on top of Activiti. Handling the signals synchronously or asynchronously doesn't really make a difference I think, because multiple threads can invoke the logic at the same time.

Best regards,
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.