Module servicekit
Servicekit: a platform-agnostic daemonization API
These are the routines that the ServiceKit user calls directly.
Functions
_servicekit.setup (events) | Setup a new service. |
_servicekit.run (detached) | Runs the service. |
_servicekit.pid () | Returns the process ID, or some other valid identifier on other platforms. |
Fields
_servicekit.version | Contains the version number of this ServiceKit instance |
_servicekit.platform | Contains the platform this ServiceKit instance runs on |
Functions
- _servicekit.setup (events)
-
Setup a new service. MUST be called before anything else.
Parameters:
events
: A table of event handler callbacks that implement your service. The minimal set of events consists of just run() and beginstop().
see also:
- _servicekit.run (detached)
-
Runs the service.
Parameters:
detached
: If true, the program detaches into the background. Set to false to keep the program in the foreground instead. If omitted, defaults to true.
- _servicekit.pid ()
- Returns the process ID, or some other valid identifier on other platforms.