Store and update resource consumer informations in the ::sim-rc/resource
key of the state.
Assuming state is associative.
Store and update resource consumer informations in the `::sim-rc/resource` key of the state. Assuming state is associative.
(define-resources state
defined-resources
unblocking-policy-registry
preemption-policy-registry)
Returns the state with the resources added in it, and values defaulted.
Returns the state with the resources added in it, and values defaulted.
(dispose state resource-name consumption-uuid)
Returns a pair:
unblockings
event.state
, with the resource resource-name
consumption of seizing-event
is disposed.Returns a pair: * the `unblockings` event. * the `state`, with the resource `resource-name` consumption of `seizing-event` is disposed.
(failure state _resource-name _seizing-event)
Updates the state
with the resource-name failing.
Updates the `state` with the resource-name failing.
(resource state resource-name)
Returns the resource called resource-name
, nil if does not exist.
The resource-name
should be called as described in the resources
map of the middleware
Returns the resource called `resource-name`, nil if does not exist. The `resource-name` should be called as described in the `resources` map of the middleware
(seize state resource-name consumed-quantity consuming-event)
Seize the resource called resource-name
and update the state
accordingly.
consuming-event
event that should be executed only when the consumed-quantity
of resource-name
was available for that event.
Returns a pair:
consumption-uuid
if the seizing found available resources.resource-name
seizing consumed-quantity
before the execution of the posponed-event
.Seize the resource called `resource-name` and update the `state` accordingly. `consuming-event` event that should be executed only when the `consumed-quantity` of `resource-name` was available for that event. Returns a pair: * `consumption-uuid` if the seizing found available resources. * the state, with the resource `resource-name` seizing `consumed-quantity` before the execution of the `posponed-event`.
(update-resource-capacity state resource-name new-capacity)
Returns a pair of:
unblocked-events
state
where the resource called resource-name
is set to its new capacity new-capacity
.Returns a pair of: * `unblocked-events` * `state` where the resource called `resource-name` is set to its new capacity `new-capacity`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close