Although most adapters connect to a single stream, it is possible to connect an adapter to multiple streams.
This may be useful if, for example, the processing load for each row is relatively heavy, and you want to spread the processing workload across multiple Sybase CEP Servers (more precisely, across multiple containers working under the same manager). To do this, you can use Sybase CEP's distributed (parallel) query feature and write a single adapter that will write to multiple input streams.
It is also possible to write a single adapter that will read from multiple output streams, which allows you to merge data from multiple streams. In most cases the easiest way to merge streams is through CCL rather than writing a custom adapter.
To write to multiple streams, you can use an out-of-process adapter. This is relatively straightforward once you know how to read from (or write to) a single stream. However, to maximize performance, you may wish to have a single in-process adapter write to read from (or write to) multiple streams. For an example of an in-process adapter that writes to multiple streams, look at the c8_multistream_adapter.cpp example, which you can find in:
C:\Program Files\SybaseC8\Server\sdk\c\examples\c8_multistream_adapter.cpp
or
/home/<userid>/sybasec8/server/sdk/c/examples/c8_multistream_adapter.cpp
This example uses C++ features and therefore cannot be compiled as a pure C program.
The term "managed" adapter in the source code refers to an "in-process" adapter.
Although the adapter uses a combination of in-process and out-of-process API calls, the adapter is considered an in-process adapter and generally must follow the rules for an in-process adapter, including:
The list of #include files should not include client (out-of-process) files such as c8client.h.
You should not link with client libraries, such as c8_sdk_client_lib.
You should call the C8ClientSDKInitialize() and C8ClientSDKShutdown() functions appropriate for in-process adapters, and should not call the versions that are appropriate for output adapters.