Skip to content
erictj 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 //listen?url=//eventCallback

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

    POST //event {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/

  1. Locker core POSTs the event to the registered URL listeners that registered in step 0.
Clone this wiki locally