Python API Interface

This section describes how adapters typically behave, and how they interact with the Python API Interface.

A typical adapter performs the following tasks:

  1. Acquiring a URI) that will uniquely identify a specific stream and telling the communication layer provided by Sybase CEP how to find that stream.

  2. Opening a connection to the stream.

  3. Writing the desired data. Typically the write operation is in a loop; the adapter will continually send multiple rows of data.

  4. Closing the connection.

When you use the Python SDK, the URI of the data stream is typically passed to the program as a command-line parameter. To find the URI of an active stream, look at the stream properties page in Sybase CEP Studio. Right-click on the stream, then choose "properties", and read the stream's URI in the Stream URI.

When you use the Python SDK, there is no explicit call to close the connection. The connection is closed when you destroy the connection object.

We recommend that you use Version 2.4.2 or later of Python.