ZenWebsocket.SafeCallback (ZenWebsocket v0.8.0)

Copy Markdown View Source

Invokes user-provided lifecycle callbacks without letting them crash the caller.

Summary

Functions

Calls fun.(pid) when fun is a 1-arity function.

Functions

invoke(fun, pid)

@spec invoke((pid() -> any()) | nil, pid()) :: :ok

Calls fun.(pid) when fun is a 1-arity function.

Returns :ok when fun is nil, and also when the callback raises, throws, or exits.