2 of 2 added 14 characters in body

Since there's not an accepted answer i throw a possible solution. Have you tried a design where the values are observables instead of the algorithm?

In c++ i would do something like this:

template <typename T>
struct observable
typedef function<void(const T&)> observer;

list<observer> observers;

T val;

void notify(const T& val)
    for(auto&& o : observers)

void operator=(const T& val)
    this->val = val;

void watch(const observer& obs)


And then in my algo:

struct myalgo
observable<info> _info;

void do_work(params)
    info myinfo;
    do { job(); info.x = "info1" info.y = "info2"; _info = myinfo; }
    while (!has_to_stop());