Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WhizzML executes WhizzML
;; Creating two scripts to be run together in the same execution
;; The scripts share no data and are not related, so they can be executed in parallel
;; the parameter for the execution is a list of maps describing each script
;; and its inputs
;; creating the first script to add two numbers
(define script1 (create-script {"source_code" "(+ a b)"
"name" "Sum script"
"inputs" [{"type" "number" "name" "a"}
{"type" "number" "name" "b"}]}))
;; creating the second script to multiply two numbers
(define script2 (create-script {"source_code" "(* c d)"
"name" "Multiplication script"
"inputs" [{"type" "number" "name" "c"}
{"type" "number" "name" "d"}]}))
;; executing both scripts in parallel with some inputs. The result will be a list of executions
(define execution-output
(wait* (create* "execution" [{"script" script1 "inputs" [["a" 1] ["b" 2]]}
{"script" script2 "inputs" [["c" 3] ["d" 4]]}])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment