Coordinator as a library

  1

Days ago I released a gist called “Coordinator” it was a simple class that handles X async actions and triggers a Runnable when all actions are complete. I saw some interest in Twitter / Github so I promoted the gist to library and I added Annotations to be easy to use.

Now you can configure Coordinator in this way:


@Actions({ AN_ACTION, ANOTHER_ACTION }) Coordinator coordinator;
@CoordinatorComplete Runnable coordinatorComplete;

public Constructor() {
    Coordinator.inject(this);
}

public void someAsyncMethod() {
    coordinator.completeAction(AN_ACTION);
}

public void someAsyncMethod2() {
    coordinator.completeAction(ANOTHER_ACTION);
}

You can check out the library here

Written by:

Christian Panadero Martinez