Programming with event loops and control loops – From actors to agents