Coordination Via Types in an Event-Based Framework