module Direct_pipe : sig ... end
Common functions that are implemented by all workers
val async_log : (_, unit, Async.Log.Message.Stable.V2.t Async.Pipe.Reader.t) t
This implementation will add another Log.Output
for Log.Global
that transfers
log messages to the returned pipe. You can subscribe to a worker's log more than
once and from different processes, as each call simply adds a new Log.Output
.
Closing the pipe will remove the corresponding Log.Output
.
NOTE: You will never get any log messages before this implementation has run (there is no queuing of log messages). As a consequence, you will never get any log messages written in a worker's init functions.
val close_server : (_, unit, unit) t
A given process can have multiple worker servers running (of the same or different worker types). This implementation closes the server on which it is run. All existing open connections will remain open, but no further connections to this worker server will be accepted.
NOTE: calling close_server
on a worker process that is only running one worker
server will leave a stranded worker process if no other cleanup has been setup
(e.g. setting up on_client_disconnect
or Connection.close_finished
handlers)