This specification is for realization message passing between master and worker, and the goal is realization Let it crash!
Here is Example for restarting worker
// master
var worker = Cluster.fork()
worker.send(.Signal(SIGTERM))
worker.on { ev in
if case .Exit = ev {
worker = try! worker.fork()
}
}
// worker
Process.on { ev in
if case .Signal(let sig) = ev {
if sig == SIGTERM {
exit(1)
}
}
}
Features
[ ] Worker.disconnet
[ ] Worker.onEvent
[ ] Process.onEvent
[ ] Process.send
[ ] Process.internalSend
InterProcessEvent Spec
enum InterProcessEvent {
case Online
case Exit(UInt64)
case Error(String)
case Signal(UInt32)
case Message(String)
}
Overview
This specification is for realization message passing between master and worker, and the goal is realization Let it crash!
Here is Example for restarting worker
Features
InterProcessEvent Spec