• Antelope Release 5.3 SunOS 5.10 2013-12-18

 

NAME

RtcacheEngine - Object class to manage rtcache streams

SYNOPSIS

import rtcache

rtce = rtcache.RtcacheEngine( streamname, pfdict )

rtce.startup()
rtce.update()
rtce.harvest()
rtce.shutdown()

rtce.inform( message)

DESCRIPTION

Overview

For each stream of objects which the rtcache(1) program is responsible for caching and delivering, a Python object manages all startup tasks, updating tasks, harvesting tasks, and shutdown tasks for that stream. The RtcacheEngine class is the base for instantiating these streams. By design the end user will neither instantiate these objects nor call their methods directly. Rather, the user will enter configuration parameters for these objects in the rtcache.pf parameter-file, after which the rtcache program will instantiate all necessary RtcacheEngine objects and call their methods when necessary.

Methods

The constructor for the RtcacheEngine objects takes two arguments, the string name for the stream as streamname and the Python hash equivalent of an Antelope parameter-file used to configure the stream, given as the pfdict parameter. The RtcacheEngine object has four main methods, called startup, update, harvest, and shutdown, which are invoked by the rtcache program to accomplish these tasks. The harvest method is handed the request parameter-file as its first (and only) input argument, in the form of a python dictionary. There is also an inform method for the RtcacheEngine object which is invoked under rtcache(1) verbose mode to emit informational messages.

Engine Types

The RtcacheEngine object may be configured as one of several different engine types.

PARAMETER FILE

The parameter-file entries for a given RtcacheEngine object are actually contained as a sub-parameter-file within rtcache.pf for the rtcache(1) program.

common

All engine types contain the following parameters:

enginetype xwindow

The xwindow engine type requires the following configuration parameters:

enginetype diy

The diy engine type requires the following configuration parameters:

RETURN VALUES

The RtcacheEngine constructor returns an object instantiated from the RtcacheEngine class.

SEE ALSO

rtcache(1)

BUGS AND CAVEATS

Because the content of the diy engine's startup_script, harvest_script, update_script, and shutdown_script parameters are given to a Python interpreter, they must be indented properly (no tab characters, and with indentation level having syntactic meaning). However, any uniform level of indentation will be removed from each of these parameters before the contents are given to the Python interpreter, allowing the rtcache.pf parameter-file to be lined up in an easily readable layout. The color depth for the xwindow engine is hard-wired to 24 bits to support the current screen-grabbing and image-conversion strategy. Images less than 10 pixels wide or high will be ignored by the xwindow engine due to the way the search is handled for the correct window inside the virtual server display. This strategy could perhaps be improved. display ports for xwindow style engines are allocated first-come, first-serve (usually in alphabetical order based on streamname). This means that if an engine with virtual_display set to auto grabs a particular display port, any engine that comes along afterwards with a manual setting requesting that display port will fail because the port is already taken. The automatic search for a display number will stop after failing with a contiguous block of successive candidate ports. Currently this search limit is hard-wired to 100 ports. The update_script is intended to be fairly lightweight, finishing quickly with the possible exception of the initial run at startup. If this is not true, incoming requests may time-out if any one update procedure takes too long. rtcache has no way of stopping a long-running update_script.

AUTHOR

Kent Lindquist
Printer icon