Chapter 9. Storyboard IO

Table of Contents

Connecting to a Storyboard Application
Sending Events to a Storyboard Application
Setting Application Data
Receiving Events from a Storyboard Application
Storyboard IO Utilities
Storyboard IO API

The Storyboard IO API provides a platform independent communication API that allows inter-task and inter-process queued message passing. This is primarily used to allow external communication with a Storyboard application.


Storyboard IO was previously known as GREIO

The Storyboard IO API layers on top of native message passing and communication APIs, dependent on the operating system:


SysV message queue


SysV message queue


QNX POSIX message queue (mqueue server or mq server/library)

Using the SBIO_MQ_PATH environment variable you can determine which message queue technology will be used. By default the standard mqueue server and corresponding C library mq_* functions will be used.

If the SBIO_MQ_PATH environment variable is set to point at the library (ie SBIO_MQ_PATH=/usr/lib/ then the default binding for the message queue implementation can be changed to use the mq server and the corresponding mq library functions.

If the SBIO_MQ_PATH environment variable is used, then it must be used consistently with all Storyboard IO clients and servers that want to communicate with one another.





The API provides transport delivery guarantees for messages that are placed into the queue regardless of the implementation. The maximum transport size of a message and the total queue capacity varies slightly from implementation to implementation however a 2K message size should be considered a design limit with the practical implementation limit around a 4K message payload size.

Storyboard IO integration with the Storyboard Engine is implemented as a plugin. It is possible to create alternate Storyboard IO implementations that take advantage of custom communication facilities available on a platform.

The Storyboard IO plugin provides a single communication channel which clients can used to inject events into the Storyboard application. These events will be queued and dispatched in the same manner as internally generated events.

Client applications can use Storyboard IO to create their own communication channels and then receive events from that channel from the Storyboard application or from any other Storyboard IO client.

Connecting to a Storyboard Application

In order to communicate with a running Storyboard application the external application must first attach to the application's Storyboard IO channel.  By default this channel is named after the deployment bundle file (ie [bundlename].gapp), however the name of this channel can be customized by specifying -ogreio,channel=newname as an option to sbengine. Alternatively, on some platforms, it is also possible to set a GREIONAME environment variable to the channel name.

Once the channel name is determined, the connection to the channel can be established with the gre_io_open() function. This will connect to the channel and return a handle that can be used for future communication.

Once the application has determined that no further communication is necessary the channel should be closed via the gre_io_close() function.