Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit ee56287

Browse files
author
Jim Clark
committed
Add async dispatch to README.md
1 parent e5353b7 commit ee56287

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The `pods/load-pod` call is convenient for a repl-session, or a script, but what
5353

5454
Here is an example of bindings that will resolve at compile-time and go through the same dispatch.
5555

56-
```
56+
```clj
5757
; require the babashka.pods in a namespace
5858
(require '[babashka.pods.impl :as impl])
5959

@@ -77,9 +77,17 @@ Here is an example of bindings that will resolve at compile-time and go through
7777
(future (impl/processor pod))
7878
{:pod/id (:pod-id pod)})))
7979

80-
;; statically define dispatch functions
80+
;; statically define dispatch functions - this is synchronous
8181
(defn parse [s]
8282
(impl/invoke-public "pod.atomisthq.docker" "pod.atomisthq.docker/parse-dockerfile" [s] {}))
83+
84+
;; async example
85+
(defn generate-sbom [s]
86+
(impl/invoke-public "pod.atomisthq.docker" "pod.atomisthq.docker/-generate-sbom"
87+
[s cb]
88+
{:handlers {:done (fn [])
89+
:success cb
90+
:error (fn [err]}})))
8391
```
8492

8593
```

0 commit comments

Comments
 (0)