(await! {:com.wsscode.async.processing/keys [request-id timeout] :as msg})
Wait for some async response, this returns a channel that will receive the data once the other side responds to the ::request-id.
When message doesn't have a ::request-id this function is a noop, so its safe to call in the message return point of your code.
Wait for some async response, this returns a channel that will receive the data once the other side responds to the ::request-id. When message doesn't have a ::request-id this function is a noop, so its safe to call in the message return point of your code.
(capture-response! {:com.wsscode.async.processing/keys [response-id
request-response]})
Use this helper in the receiving side of events, right before sending to your original handler message. This will ensure that response messages are propagated back to the listener.
Use this helper in the receiving side of events, right before sending to your original handler message. This will ensure that response messages are propagated back to the listener.
(event-queue! handler)
(event-queue! {:com.wsscode.async.processing/keys [channel]} handler)
Returns a callback handler that will respond to events in a serialized queue. When the user handler returns a channel, the next message will wait until the current one finished processing before moving on. Use this on callback handlers that need serialization to avoid concurrency issues.
Returns a callback handler that will respond to events in a serialized queue. When the user handler returns a channel, the next message will wait until the current one finished processing before moving on. Use this on callback handlers that need serialization to avoid concurrency issues.
(random-request-id)
Portable helper to generate random UUID.
Portable helper to generate random UUID.
(reply-message {:com.wsscode.async.processing/keys [request-id]} value)
Helper to make a response map for a given message with a request-id.
Use this to generate response data from async events.
Helper to make a response map for a given message with a request-id. Use this to generate response data from async events.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close