Module: workers/scion-queue

workers/scion-queue

This is a Worker script that is used as "threaded queue" for managing SCION event execution: New events for SCION are queued in order to allow raising new events from within SCION-event-processing.

This "threaded queue" receives messages from the "Android environment engine" of mmir.DialogEngine - see manager/dialog/engineConfig.js::_androidFactory.

The message / work flow is as follows:

  • on receiving newJob: add new event-job to the queue
  • on receiving readyForJob:
  • if queue is empty: does nothing
  • if queue is not empty: take next job from queue and send it as a toDo message to SCION

Members

private,innerqueue

Methods

private,innerdistributeJobs()

Handler for sending messages.

In case of readyForJob: take next job and send it to SCION, i.e. post a message e with
{String} e.data.command = toDo)
{Object} e.data.toDo the job object (that was added before to the queue with command / message newJob)