cmp.st-utils
info-map->definition-key
(info-map->definition-key m)Converts a state-map into the related definition key.
key->ctrl-key
(key->ctrl-key k)Returns the ctrl-key for a given key k. In other words: ensures k to be a ctrl-key.
(key->ctrl-key "wait@container@0@state@0@0")
;; "wait@container@0@ctrl"
(key->ctrl-key
(key->ctrl-key
(key->ctrl-key "wait@container@0@state@0@0")))
;; "wait@container@0@ctrl"
key->func
(key->func k)Returns the name of the function for the given key. Possible values are:
ctrlstaterequestresponseelemdecrtitledefinitionmesssage
key->info-map
(key->info-map k)Builds a info-map out of the key structure.
Example:
(key->info-map "")
;;{:mp-id nil,
;; :struct nil,
;; :no-idx nil,
;; :func nil,
;; :seq-idx nil,
;; :par-idx nil}
key->mp-id
(key->mp-id k)Returns the name of the key space for the given key.
May be: * tasks * <mp-id>
key->no-idx
(key->no-idx k)Returns the value of the key corresponding to the given key container or definitions index.
key->par-idx
(key->par-idx k)Returns an integer corresponding to the givens key parallel index.
key->request-key
(key->request-key k)Turns the given state-key into a request-key This key is used to store the assembled task right before it is started off.
Example:
(key->response-key "ref@container@0@state@0@0")
;; devs@container@0@response@0@0
key->response-key
(key->response-key k)Turns the given state-key into a response-key.
Example:
(key->response-key "ref@container@0@state@0@0")
;; devs@container@0@response@0@0
key->retry-key
(key->retry-key k)Turns the given *-key into a retry-key This key is used to store the number of retries.
key->seq-idx
(key->seq-idx k)Returns an integer corresponding to the givens key sequential index.
key->struct
(key->struct k)Returns the name of the structure for the given key. The structure is the name of the key at the second position. Possible values are:
<taskname>definitionscontainerexchangeidmeta
replace-key-at-level
(replace-key-at-level l k r)Generates a new key by replacing an old key k at the given position l with the given string r.
REVIEW The key levels should have a name or keyword. Passing integers (l) is unimaginative.
seq-idx->all-par
(seq-idx->all-par v i)Returns a vector of info-maps with all par steps for a given i.
Example:
(seq-idx->all-par [{:seq-idx 0 :par-idx 0 }
{:seq-idx 1 :par-idx 0 }
{:seq-idx 1 :par-idx 1 }] 1)
;; =>
;; [{:seq-idx 1 :par-idx 0 :state :ready}
;; {:seq-idx 1 :par-idx 1 :state :ready}]