Event queue

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 20: Line 20:
  
 
I believe (justincc) that the viewer polls the event queue a second after the previous response.  In addition, if the server returns an error then there is a 15 second wait until the queue is polled again.  However, this needs to be confirmed by checking the behaviour of a current viewer.
 
I believe (justincc) that the viewer polls the event queue a second after the previous response.  In addition, if the server returns an error then there is a 15 second wait until the queue is polled again.  However, this needs to be confirmed by checking the behaviour of a current viewer.
 +
 +
==Polling==
 +
The PollServiceRequestManager in OpenSim.Framework.Servers.HttpServer sets up 3 PollServiceWorkerThreads and 1 LongPollServiceWatcherThread to handle poll requests such as the EventQueue.

Revision as of 15:57, 11 August 2014

The event queue is a Linden Lab viewer protocol mechanism whereby the simulator can place messages on a queue which is regularly TCP polled by a client/viewer. In this way, a simulator can directly send data back to a viewer.

The Linden Lab wiki has a very short description of the event queue but no further detail.

In OpenSimulator, the event queue is implemented by the EventQueueGetModule in the OpenSim.Region.ClientStack.LindenCaps package. This fulfils the interface IEventQueue.

You can see examples of existing messages (e.g. PlacesReplyMessage, EnableSimulator) in the EventQueueGetModule and EventQueueHelper message constrruction class. These appear to be pretty much undocumented on the Linden Lab side. They eventually need documentation here.

As events are distinguished by a message parameter, one could construct an arbitary for a modified client/viewer that can recognize it with the EventQueueHelper.BuildEvent() static method and then inject that data by obtaining a reference to EventQueueGetModule, for example with

IEventQueue eq = scene.RequestModuleInterface<IEventQueue>();
if (eq != null)
    eq.Enqueue(EventQueueHelper.BuildEvent("myevent", eventBodyOsd));

OpenStructuredData (OSD) is the name of a data format that is a superset of Linden Lab Structured Data (LLSD). It's XML which contains some information about embedded types.

One would want to pick message names that are unlikely to clash with any future Linden Lab additions or other OpenSimulator extensions.

I believe (justincc) that the viewer polls the event queue a second after the previous response. In addition, if the server returns an error then there is a 15 second wait until the queue is polled again. However, this needs to be confirmed by checking the behaviour of a current viewer.

Polling

The PollServiceRequestManager in OpenSim.Framework.Servers.HttpServer sets up 3 PollServiceWorkerThreads and 1 LongPollServiceWatcherThread to handle poll requests such as the EventQueue.

Personal tools
General
About This Wiki