jeudi 26 janvier 2017

Workflow Design pattern combined with Task Pattern?

I'm currently working on an enterprise application that's performing a long non-linear tasks.

An abstraction of the workflow:

  1. Gather neccessary information (can take minutes, but not always necessary)
  2. Process data (always takes very long)
  3. Notify several worker who post-process the result (in new tasks)

Now, I have created 2 services, that can solve step 1 and 2. As the services shouldn't know of each other, I want to have a higher order Component that coordinates the 3 steps of an task. Think of it as an Callable which sends the task to service one, wakes up again when service 1 returnes an result, sends it to service 2, ..., sends final result to all post-processors and ends task. But as it is likely to have 100'000s of queued tasks, I don't want to start 100'000s threads with task-control callables which even if being idle like 99.9% of the time still would be an massive overhead.

So got anybody an idea of controling this producer consumer queue-like pattern encapsulated in a task-object or somebody knows of an framework simplifying my concern?

Aucun commentaire:

Enregistrer un commentaire