View Source sidejob (sidejob v2.2.0)

Summary

Functions

Same as call/3 with a default timeout of 5 seconds.
Perform a synchronous call to the specified resource, failing if the resource has reached its usage limit.
Perform an asynchronous cast to the specified resource, failing if the resource has reached its usage limit.
Same as new_resource/4 except that the number of workers defaults to the number of scheduler threads.

Create a new sidejob resource that uses the provided worker module, enforces the requested usage limit, and is managed by the specified number of worker processes.

Check if the specified resource exists. Erlang docs call out that using erlang:module_exists should not be used, so try to call a function on the module in question and, if it succeeds, return true. Otherwise, the module hasn't been created so return false.
Same as unbounded_call/3 with a default timeout of 5 seconds.
Perform a synchronous call, ignoring usage limites.
Perform an asynchronous cast to the specified resource, ignoring usage limits

Functions

Same as call/3 with a default timeout of 5 seconds.
Link to this function

call(Name, Msg, Timeout)

View Source
Perform a synchronous call to the specified resource, failing if the resource has reached its usage limit.
Perform an asynchronous cast to the specified resource, failing if the resource has reached its usage limit.
Link to this function

new_resource(Name, Mod, Limit)

View Source
Same as new_resource/4 except that the number of workers defaults to the number of scheduler threads.
Link to this function

new_resource(Name, Mod, Limit, Workers)

View Source

Create a new sidejob resource that uses the provided worker module, enforces the requested usage limit, and is managed by the specified number of worker processes.

This call will generate and load a new module, via sidejob_config, that provides information about the new resource. It will also start up the supervision hierarchy that manages this resource: ensuring that the workers and stats aggregation server for this resource remain running.
-spec resource_exists(Mod :: atom()) -> boolean().
Check if the specified resource exists. Erlang docs call out that using erlang:module_exists should not be used, so try to call a function on the module in question and, if it succeeds, return true. Otherwise, the module hasn't been created so return false.
Link to this function

unbounded_call(Name, Msg)

View Source
Same as unbounded_call/3 with a default timeout of 5 seconds.
Link to this function

unbounded_call(Name, Msg, Timeout)

View Source
Perform a synchronous call, ignoring usage limites.
Link to this function

unbounded_cast(Name, Msg)

View Source
Perform an asynchronous cast to the specified resource, ignoring usage limits