Speed up development of Babashka pods.
This little library takes care of the overhead of communicating with Babashka.
Specify the namespaces and functions that should be exposed to Babashka scripts
in a pod-config
and call pod-racer.core/launch
. For example, with this pod
namespace:
(ns pod.main
(:require [pod-racer.core :as pod]))
(defn pod-fun
[num]
(inc num))
(def pod-config
{:pod/namespaces
[{:pod/ns "pod.example"
:pod/vars [{:var/name "pod-fun"
:var/fn pod-fun}]}]})
(defn -main [& _args]
(pod/launch pod-config))
And this Babashka script:
#!/usr/bin/env bb
(require '[babashka.pods :as pods])
(pods/load-pod ["clojure" "-M" "-m" "pod.main"])
(require '[pod.example :as example])
(example/pod-fun 1)
The result will be:
$ ./pod_test.clj
2
- tabl - Make tables from data in your terminal
- brisk - Freeze and thaw with Nippy at the command line
No support (yet) for:
- Lazy loading of namespaces
- Async functions
Copyright © 2020-2022 Nate Jones
Distributed under the EPL License. See LICENSE.