Skip to content

Instantly share code, notes, and snippets.

@mmerce
Last active April 24, 2019 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmerce/2be75b0470c50f0c9580714bacc8bb6e to your computer and use it in GitHub Desktop.
Save mmerce/2be75b0470c50f0c9580714bacc8bb6e to your computer and use it in GitHub Desktop.
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