Skip to content
temas edited this page Jul 7, 2011 · 5 revisions

Events can be emitted from any service. And each of those events can be one of several types of actions. Other services can listen for events based on a particular service type.

Here is a typical event flow for services listening for each other:

  1. Services can listen for the service types they're interested in, by registering with Locker's event core

    GET /<serviceRequestingTheListen>/listen?type=test%2fevent&cb=eventCallbackURI

  2. When a service emits an event it sends core the object to emit, the action, and the service type.

    {type:"contact/google", obj:{..}, action:"create"}```
    
    
  3. Locker core wraps the object in a simple structure with the id of the service that is emitting the event and the local timestamp that it was processed

    {via:"twitter", action:"create", timestamp:"2001-11-22T...", obj:{...} }

    (via is the ID of the me.json file of the connector/

  4. Locker core POSTs the event to the registered URL listeners that registered in step 1.

Clone this wiki locally