MidWay Documentation
Prev Top Next

The MidWay API.

This is a brief description of the API, the full details are in the man pages. Note that MidWay consider everything that begins with mw, _mw, __mw its own private name space.
C Function Client or Server API Description Implemented
mwattach() both Attaches the process to a running MidWay instance.It specifies if the process is a server or client. Yes
mwdetach() both Detatches from a running MidWay instance Yes
mwcall() client Performs a synchronus service call Yes
mwacall() client Performs an asychronus service call, reply must be retrieved with mwfetch() Yes
mwfetch() client Retrives a reply from the service routine, either 
a specific, or the first available.
mwreply() server Send the reply back to the calling client, must be used in a service routine. Yes
mwreturn() server A macro that do mwreply() and a C return Yes
mwforward() server Forwards the request to another service, the reply is sendt directly to the client by the other service routine. Yes
mwalloc() both allocates a buffer in shared memory, used by mwcall(), mwreply() and their likes to store the data buffer passed.  Yes
mwrealloc() both resizes a shared memory buffer allocated by mwalloc() No
mwfree() both Frees a buffer alloacted by mwalloc() Yes
mwMainLoop() server Wait forever on a service request, and calls the associoated service routine Yes
mwservicerequest() server Waits for a service request, call the service routine and returns. Used if you need a custom MainLoop. Yes
mwbegin() client Meant to do the start a distributed transaction. Transactions are not yet implemented, now it only set a deadline on the service request. If a server recieves an expired request is is silently dropped. mwcall() and mwfetch() return when their request expire. No
mwcommit() client resets deadline to 0. No
mwabort() client currently does the same as mwcommit() No
mwlog() both Provides a common logging facility Yes
mwsetlogprefix() both If the process want to log to a private log. Yes
mwsetloglevel() both Specifies how much logging this process should do. From only errors to full debug. Yes
mwopenlog() both Intended to replace mwsetlogprefix and mwsetloglevel. Modeled on openlog(3)/syslog(3) Yes

Prev Top Next
© 2000 Terje Eggestad