Struct CatalystCoprocessorFnInfo¶
Defined in File TransportABI.h
Struct Documentation¶
-
struct CatalystCoprocessorFnInfo¶
The lifecycle hooks of a coprocessor function or launcher. The library defining the function may export them as
const CatalystCoprocessorFnInfo *<symbol>_info(void), where<symbol>is the function’s name. The runtime looks<symbol>_infoup only in the library that defines<symbol>. A per-message function without it is bound with a null ctx.abi_version: the version the library is written against, at least 1. The struct only grows at its end, and the runtime reads only the fields of the versions it knows. A field added by a later version must be optional: null or zero keeps the behaviour of the earlier versions. Version 2 adds no fields: it changes what a launcher’s persistent engine reads and writes, which is codec frames laid out as CoprocLaunchDesc (Transport.hpp) describes, replies included. A launcher must export<symbol>_inforeporting at least version 2, and the runtime refuses one that does not, since an engine built for version 1 would never publish a reply the runtime recognises. A per-message function may report 1 or 2.reserved: zero. It fills the 4 bytes beforeinit, which would otherwise be padding, and the runtime ignores it. A later version may give it a meaning, for which zero keeps the behaviour of this one.init(may be null): called once, before the function is bound, with the node’sfn.-prefixed config keys, prefix removed, askey=value;.... Returns the ctx the function is called with, or null if the function cannot be configured. Catalyst’s frontend adds the controller’s message sizes asin_bytes=<n>andout_bytes=<n>, soinitmust accept both keys. A function may check them against what it processes and return null on a mismatch.fini(may be null): releases the ctxinitreturned, once the session using it has stopped.
The returned pointer must stay valid for the life of the library.