Solved by albanD in post #4 
              
              
                You might want to check the code in more details, but the “basic architecture” described in the wikipedia article seems to match the code in spirit.