Implement shutdown op for examples

This commit is contained in:
Michiel Borkent 2020-05-07 23:26:11 +02:00
parent 4e70b92584
commit 859529b44b
3 changed files with 8 additions and 2 deletions

View file

@ -105,6 +105,10 @@ fn handle_incoming(val: bc::Value) {
_ => panic!(var)
};
},
"shutdown" => {
// TODO: clean up stuff?
std::process::exit(0);
}
_ => panic!(op)
}
}

View file

@ -46,4 +46,5 @@
(write {"value" (pr-str (apply (lookup var) args))
"id" id
"status" ["done"]})
(recur))))))))
(recur))
:shutdown (System/exit 0)))))))

View file

@ -56,7 +56,8 @@ def main():
conn.commit()
conn.close()
elif op == "shutdown":
sys.exit(0)
if __name__ == "__main__":
main()