The stream control mechanism has changed a number of ways

The VisDataMux node

Up to now, to read an MS we would call mqs.init(inputrec,outputrec,...) and the kernel would auto-magically start feeding MS data to sinks and spigots. This was rather opaque and difficult to generalize. I have therefore divested the kernel itself of this responsibility, and moved it into a special node called the MeqVisDataMux. The mqs.init() function has been phased out.

A MeqVisDataMux (or VDM for short) node connects to a set of sinks and spigots. When you give it a specially-formed request --- one that contains input and output fields that are similar to the input and output record of the former mqs.init() command --- it begins reading/writing a visibility stream and activating the sinks. Once the stream is finished it returns an (empty) result. Here's an example (from an updated MeqServer/test/matrix343.py):

A VDM will be created for you automatically if you create any sinks and/or spigots. All sinks and spigots will automatically become children of this node. This auto-created VDM is unimaginatively named VisDataMux. If you prefer to give it a different name, you can create the VDM manually, e.g.:

All sinks and spigots will again be made its children automatically. In the future we may allow trees with multiple muxes reading different data sources, in which case each mux's sinks and spigots will need to be assigned explicitly.

Other major changes

(Refer to the old StreamControl document for details of the old implementation.)

VisDataMux details

A VDM checks the types of its children, and distinguishes between spigots and sinks. Spigots only get updated with visibility data and are otherwise ignored, while sinks are polled with requests when data snippets arrive.

At the moment, all created spigots and sinks are associated with a single VDM. This is created implictly if the user has not defined one explicitly. This logic is taken care of at the TDL pre-processing level.

VDM I/O record structure

The VDM is activated by passing it a Request with an input subrecord (the output subrecord is optional; if it is not specified, the VDM works as read-only). The subrecord is structured similarly to the old StreamControl, with an important difference: the type of the channel is identified by a field name, while the init-record for the channel is placed in a subrecord of that name. Thus,

The VDM has a number of extra options that apply to all channel types. These are specified by optional fields directly in the input and output` records:

VDM sequence children

A VDM can also perform some of the functions of a ReqSeq. It has three optional labelled children, start, pre and post. These children are normally unassigned, but you can assign them if you create a VDM explicitly. These children are called as follows:

NewStreamControl (last edited 2006-01-04 16:41:24 by OlegSmirnov)