$observer_session = $session->observer( .. options .. );

The observer() function creates and returns a reference to a connection to a Domain Manager on which subscribed events can be received.

This establishes a new socket between the client and Domain Manager. Once connected, events can be subscribed to by using the various subscribe methods, and they can be received by using:

 @event_info = $observer_session->receiveEvent( );

Specifying the option connectEvents => 1 to the observer() function causes server disconnection to be notified as a DISCONNECT event rather than an [13] I/O Error. However, unlike ASL, the reconnection is not performed automatically. The script can use the $session->reattach() call to attempt an explicit reconnection and must then reestablish any event subscriptions and other contexts.

Specifying the option ignoreOld => 1 causes events generated before the connection was established to be discarded automatically. The use of this option is not generally recommended since the atomicity of time measurement on UNIX makes its results somewhat unpredictable.

Repeated calls to the observer() method of a session return references to the same observer. It is not possible to create multiple observers on the same session.