Liking cljdoc? Tell your friends :D

automaton-simulation-de.rc.impl.resource.queue

The queue of a resource is containing all event execution which are blocked while waiting for a resource to be available.

The queue of a resource is containing all event execution which are blocked while waiting for a resource to be available.
raw docstring

queue-eventclj/s

(queue-event resource consumed-quantity event)

Returns the resource with sim-de-rc/queue updated with a sequence containing maps:

  • ::sim-de-rc/consumed-quantity is the consumed-quantity.
  • ::sim-de-rc/seizing-event is the event .

consumed-quantity should be a strictly positive integer, otherwise queueuing is ignored.

This is called when the resource is not available and the event should be postponed for a moment later on when the resource will be available.

Returns the `resource` with `sim-de-rc/queue` updated with a sequence containing maps:
* `::sim-de-rc/consumed-quantity` is the `consumed-quantity`.
* `::sim-de-rc/seizing-event` is the `event` .

`consumed-quantity` should be a strictly positive integer, otherwise queueuing is ignored.

This is called when the resource is not available and the event should be postponed for a moment later on when the resource will be available.
raw docstring

schemaclj/s

(schema)

Schema of a queue. A queue should be a vector and not a general collection to preserve order.

Schema of a `queue`.
A queue should be a vector and not a general collection to preserve order.
raw docstring

unqueue-eventclj/s

(unqueue-event {:automaton-simulation-de.rc/keys [queue cache] :as resource}
               available-capacity)

Removes events in the queue of resource resource, based on policy chosen, as many as needed to fullfill the available-capacity, the capacity that is free now and that we would like to try to execute.

Returns a two entry vector:

  • the blockings removed from the queue and which execution will be attempted.
  • and the updated resource without the event in its queue anymore. Note that it may happen that the availability changes before that event is really executed, (i.e. it may happen that capacity change, higher priority events change the number of available resources...).
Removes events in the queue of resource `resource`, based on policy chosen, as many as needed to fullfill the `available-capacity`, the capacity that is free now and that we would like to try to execute.

Returns a two entry vector:
* the `blockings` removed from the queue and which execution will be attempted.
* and the updated resource without the event in its queue anymore.
Note that it may happen that the availability changes before that event is really executed, (i.e. it may happen that capacity change, higher priority events change the number of available resources...).
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close