cmp.st-utils

cont-ctrl-key

(cont-ctrl-key mp-id i)

cont-defin-key

(cont-defin-key mp-id i)(cont-defin-key mp-id i j k)

cont-descr-key

(cont-descr-key mp-id i)

cont-elem-key

(cont-elem-key mp-id i)

cont-prefix

(cont-prefix mp-id)

cont-state-key

(cont-state-key mp-id i)(cont-state-key mp-id i j k)

cont-title-key

(cont-title-key mp-id i)

defins-class-key

(defins-class-key mp-id i)

defins-cond-key

(defins-cond-key mp-id i)(defins-cond-key mp-id i j)

defins-ctrl-key

(defins-ctrl-key mp-id i)

defins-defin-key

(defins-defin-key mp-id i)(defins-defin-key mp-id i j k)

defins-descr-key

(defins-descr-key mp-id i)

defins-prefix

(defins-prefix mp-id)

defins-state-key

(defins-state-key mp-id i)(defins-state-key mp-id i j k)

exch-key

(exch-key mp-id s)

exch-prefix

(exch-prefix mp-id)

id-key

(id-key mp-id id)

id-prefix

(id-prefix mp-id)

info-map->ctrl-key

(info-map->ctrl-key m)

Converts a state-map into the related ctrl key.

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->definition-key

(key->definition-key k)

key->func

(key->func k)

Returns the name of the function for the given key. Possible values are:

  • ctrl
  • state
  • request
  • response
  • elem
  • decr
  • title
  • definition
  • messsage

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->level

(key->level k)

The 4th position at listener reg keys.

key->message-key

(key->message-key k)

Returns the message key.

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->no-jdx

(key->no-jdx k)

The 4th position at definitions keys.

key->par-idx

(key->par-idx k)

Returns an integer corresponding to the givens key parallel index.

key->reg-map

(key->reg-map k)

Generates a map from the reg-key.

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->state-key

(key->state-key k)

Returns the state-key for a given key k. ```

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>
  • definitions
  • container
  • exchange
  • id
  • meta

key-at-level

(key-at-level k l)

Returns the value of the key k at the level l.

meta-descr-key

(meta-descr-key mp-id)

meta-name-key

(meta-name-key mp-id)

meta-ncont-key

(meta-ncont-key mp-id)

meta-ndefins-key

(meta-ndefins-key mp-id)

meta-prefix

(meta-prefix mp-id)

meta-std-key

(meta-std-key mp-id)

re-sep

The regex version of the seperator.

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.

sep

Short-term-database (st) path seperator. Must not be a regex operator (like . or |)

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}]

struct-state-key

(struct-state-key mp-id struct i)

task-key

(task-key task-name)

task-prefix

(task-prefix)

vec->key

(vec->key v)

Joins the vec to a key.