(clear runtime program-id)
clears the program and past spawn information
clears the program and past spawn information
(count-spawn runtime program-id)
counts all running spawns
counts all running spawns
(create-handler {:keys [type] :as program} spawn)
creates a run handler
(create-handler (assoc defaults :type :basic) (create-spawn)) => fn?
creates a run handler (create-handler (assoc *defaults* :type :basic) (create-spawn)) => fn?
(create-handler-basic program spawn)
creates a basic handler
creates a basic handler
(create-handler-constant {:keys [args-fn] :as program} spawn)
creates a constant handler
creates a constant handler
(create-spawn)
(create-spawn {:keys [create-fn continue-fn interval global full state]
:as program}
spawn-id)
creates a new spawn
(-> (create-spawn (merge defaults {:interval 1}) "spawn.1") (spawn-info)) => {:id "spawn.1", :status :created, :duration "0ms", :jobs {:submitted 0 :succeeded 0 :errored 0 :waiting 0}, :state nil}
creates a new spawn (-> (create-spawn (merge *defaults* {:interval 1}) "spawn.1") (spawn-info)) => {:id "spawn.1", :status :created, :duration "0ms", :jobs {:submitted 0 :succeeded 0 :errored 0 :waiting 0}, :state nil}
(earliest-spawn runtime program-id)
returns earliest created spawn
returns earliest created spawn
(get-all-spawn runtime program-id)
returns all running spawns
returns all running spawns
(get-job spawn job-id)
(get-job spawn job-id ks)
retrieves a job given key
(-> (doto (create-spawn) (add-job "j.1" {:id "j.1"}))
(get-job "j.1"))
=> {:id "j.1"}
retrieves a job given key (-> (doto (create-spawn) (add-job "j.1" {:id "j.1"})) (get-job "j.1")) => {:id "j.1"}
(get-program runtime program-id)
gets the program given runtime and program-id
(get-program |rt3| :test-program) => {}
gets the program given runtime and program-id (get-program |rt3| :test-program) => {}
(get-props spawn)
(get-props spawn k)
gets the spawn prop given key
(-> (create-spawn) (get-props :submitted)) => 0
gets the spawn prop given key (-> (create-spawn) (get-props :submitted)) => 0
(get-spawn runtime program-id spawn-id)
gets running spawn with id
gets running spawn with id
(get-state runtime program-id)
gets the global state for the program-id
(get-state |rt3| :test-program) => {}
gets the global state for the program-id (get-state |rt3| :test-program) => {}
(handler-run {:keys [args-fn main-fn merge-fn success-fn error-fn]}
{:keys [state] :as spawn}
{:keys [time return] job-id :id :as job})
handles the
(let [ret (h/incomplete) job {:id "j.0" :time 0 :return ret} spawn (doto (create-spawn) (add-job "j.0" job)) result {:task (handler-run defaults spawn job)}] (assoc result :return @ret :meta @(:output spawn))) => (contains-in {:task ["j.0" 0] :return nil :meta {:status :success, :data nil, :exception nil, :time 0, :start integer? :end integer?}})
handles the (let [ret (h/incomplete) job {:id "j.0" :time 0 :return ret} spawn (doto (create-spawn) (add-job "j.0" job)) result {:task (handler-run *defaults* spawn job)}] (assoc result :return @ret :meta @(:output spawn))) => (contains-in {:task ["j.0" 0] :return nil :meta {:status :success, :data nil, :exception nil, :time 0, :start integer? :end integer?}})
(kill-all runtime program-id)
kills all the running tasks
(-> (doto |rt3| (kill-all :test-program)) (count-spawn :test-program)) => 0
kills all the running tasks (-> (doto |rt3| (kill-all :test-program)) (count-spawn :test-program)) => 0
(kill-spawn runtime program-id spawn-id)
stops a spawn and all jobs
(kill-spawn |rt3| :test-program "s1") => spawn?
stops a spawn and all jobs (kill-spawn |rt3| :test-program "s1") => spawn?
(latest runtime program-id)
returns the latest active or past spawn
returns the latest active or past spawn
(latest-spawn runtime program-id)
returns latest created spawn
returns latest created spawn
(latest-stopped runtime program-id)
returns the most recently stopped spawn
returns the most recently stopped spawn
(list-spawn runner program-id)
(list-spawn runtime program-id order)
lists all running spawns
lists all running spawns
(list-stopped runtime program-id)
lists all stopped spawns
lists all stopped spawns
(run runtime program-id)
(run runtime program-id opts spawn-id)
constructs and starts a spawn loop
constructs and starts a spawn loop
(schedule-timing type props last)
(schedule-timing type props last now)
calculates the timing for the next schedule
(schedule-timing :constant {:interval 1000} 500 635) => [1500 865]
calculates the timing for the next schedule (schedule-timing :constant {:interval 1000} 500 635) => [1500 865]
(send-result {:keys [output] :as spawn} result)
sends the result to spawn output
sends the result to spawn output
(set-props spawn k v & more)
updates the spawn props
(-> (create-spawn) (set-props :submitted inc :errored 4 :started true) (select-keys [:submitted :errored :started])) => {:submitted 1, :errored 4, :started true}
updates the spawn props (-> (create-spawn) (set-props :submitted inc :errored 4 :started true) (select-keys [:submitted :errored :started])) => {:submitted 1, :errored 4, :started true}
(spawn-info {:keys [id board props output state exit] :as spawn})
returns the spawn info
returns the spawn info
(spawn-loop runtime
{:keys [time-fn continue-fn] :as program}
{:keys [props exit board] :as spawn})
creates a spawn loop
creates a spawn loop
(spawn-save-past runtime program-id {spawn-id :id :as spawn})
helper function to move spawn from :running to :past
helper function to move spawn from :running to :past
(spawn-status {:keys [props exit] :as spawn})
returns the spawn status
returns the spawn status
(stop-all runtime program-id)
stops all the running tasks
(-> (doto |rt3| (stop-all :test-program)) (count-spawn :test-program)) => 0
stops all the running tasks (-> (doto |rt3| (stop-all :test-program)) (count-spawn :test-program)) => 0
(stop-spawn runtime program-id spawn-id)
stop a spawn and waits for jobs to finish
stop a spawn and waits for jobs to finish
(update-job spawn job-id f & args)
updates a job given key
updates a job given key
(wrap-schedule {:keys [type] :as program} {:keys [props] :as spawn} schedule-fn)
wrapper for the schedule function
wrapper for the schedule function
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close