In the past we have only had to save state within the same virtual user (which we can easily do using session.set(“name”) and get it using session(“name”).
Now, we have two different scenarios that need to share data.
The two scenarios are similar (make the same REST calls) except one works on a periodic timer
and the other when certain events occur (response changes from a REST call).
In order to share data, we are using a global data structure which combines java.util classes ConcurrentHashMap and ConcurrentQueue (which support poll methods and appear to be non-blocking). We get/set data into the session via session functions before and after the actual exec that does the get/put/post.
Questions:
- Is there a way for a scenario to execute on a periodic timer (using pause) and also based on an event (which is generated due to a response to a different REST call) ?
- I am not familiar with how the akka actors are scheduled but this would be similar to injecting an actor into the scheduling queue.
- Is there a better way to share data between scenarios than using a global data structure?
Thanks,
Sajjad