z_sidejob (zotonic_core v1.0.0-rc.17)

The supervisor for websocket requests and other transient processes.

Summary

Functions

Start the Zotonic sidejob supervisor

Return the configured limit of sidejobs.

Return how many processes we can still add.

Start a sidejob. There is a limit on the number of sidejobs, so do check the return value.

Start a sidejob. There is a limit on the number of sidejobs, so do check the return value. The Context is pruned for async calls and appended to the argument list.

Start a sidejob. There is a limit on the number of sidejobs, so do check the return value.

Start a sidejob. There is a limit on the number of sidejobs, so do check the return value. The Context is pruned for async calls and appended to the argument list.

Return the amount of running processes.

Functions

init()

-spec init() -> supervisor:startchild_ret().

Start the Zotonic sidejob supervisor

limit()

-spec limit() -> non_neg_integer().

Return the configured limit of sidejobs.

space()

-spec space() -> integer().

Return how many processes we can still add.

start(MFA)

-spec start(MFA) -> {ok, pid()} | {error, Reason}
               when MFA :: {module(), atom(), list()}, Reason :: overload.

Start a sidejob. There is a limit on the number of sidejobs, so do check the return value.

start(MFA, Context)

-spec start(MFA, Context) -> {ok, pid()} | {error, Reason}
               when MFA :: {module(), atom(), list()}, Context :: z:context(), Reason :: overload.

Start a sidejob. There is a limit on the number of sidejobs, so do check the return value. The Context is pruned for async calls and appended to the argument list.

start(Module, Function, Args)

-spec start(Module, Function, Args) -> {ok, pid()} | {error, Reason}
               when Module :: module(), Function :: atom(), Args :: list(), Reason :: overload.

Start a sidejob. There is a limit on the number of sidejobs, so do check the return value.

start(Module, Function, Args, Context)

-spec start(Module, Function, Args, Context) -> {ok, pid()} | {error, Reason}
               when
                   Module :: module(),
                   Function :: atom(),
                   Args :: list(),
                   Context :: z:context(),
                   Reason :: overload.

Start a sidejob. There is a limit on the number of sidejobs, so do check the return value. The Context is pruned for async calls and appended to the argument list.

usage()

-spec usage() -> non_neg_integer().

Return the amount of running processes.