Deliberate Blocking in Akka Actors -


I understand that the actors should not block the actors to be responsive, but how I structured my service Do I want to monitor the ongoing process for an indefinite period?

For example, we are using the Amazon Keynes Connector Library. You create a connector with a configuration, which is obtained from runnab, and then call the run () method. The connector runs indefinitely, is pulling data from konasses, and it is writing in Amazon S3. In fact, if runner returns returns, then this is an error, and it needs to be restarted.

Approach (1) Just make a child actor running for each courier connector, and if the run () method returns, you throw an exception, supervisory actor exception notice and child actor resuscitation

The approach (2) will be for the actor to wrap the Kinesis connector in a future for the child, and if the future returns, the actor connector will resume in another future and it appears that a single actor has many coordinators Can manage, but what does it mean that each future is implementing in different threads?

Which approach will be with the philosophy of Akka, or is there any other approach people recommend? In general, I want to catch any problem with any connector and want to restart it. Altogether, half-dozen connectors in parallel will not be more than connectors.

I will take the approach 1 It should be noted, though that actor has a dedicated default There is no thread, but they share a thread pool (the so-called sender, see :). This means that the blocking is naturally dangerous because it does not allow the other non-blocking actor to remove pool threads (since the blocking actors do not back the pool back in the pool). Therefore, you should separate the blocked call in a fixed size pool of dedicated artists, and you should assign these artists to a pinned dispatcher. The latter step ensures that these actors do not interfere with each other ( Both of these are a dedicated thread) and ensure that these actors do not interfere in the rest of the system (all other artists will run on other dispatches, usually -dispatcher) at Holt. Although the number of threads used will increase with the number of actors of that dispatcher, however, make sure that the number of actors running on the pins will be limited.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -