Liking cljdoc? Tell your friends :D

taia.ds.datastar.use-cases.process-event.common

What travels through a component's flow — the contract the procs (process-event.controller, process-event.invoke, process-event.view) and the flow's callers share.

IN (on the flow's in-chan, whoever sends it):

{:event [event-name params] ; required :signals {…} ; the component's slice of the client's signals, or nil :request-ctx {:logged-user … :app-config … :request-method …} ; only for an event that came with a request :mulog-ctx ctx ; optional: the sender's trace, re-established :reply promise} ; optional: rides through to the render

Plain data: no Ring request. adapters.handlers.request/->event-msg builds one from a request; server-event builds one for a server event.

BETWEEN the controller and the :invoke proc (over the controller's :to-invoke / :from-invoke ports): the incoming message with the ctx being stepped, plus :invoke on the way out and the raised event on the way back. Any other key rides along, :mulog-ctx and :reply included.

To the view and OUT (on the flow's out-chan): {:event :initial-ctx :ctx …} with the same :mulog-ctx and :reply, plus :html once the view has rendered — or an error message when a step threw (error, error-of). One per event, or one per step in an :async? flow (a connected component's). Errors travel as messages, never to the flow's error-chan.

What travels through a component's flow — the contract the procs
(`process-event.controller`, `process-event.invoke`, `process-event.view`)
and the flow's callers share.

IN (on the flow's in-chan, whoever sends it):

  {:event       [event-name params]  ; required
   :signals     {…}                  ; the component's slice of the client's signals, or nil
   :request-ctx {:logged-user … :app-config … :request-method …}
                                     ; only for an event that came with a request
   :mulog-ctx   ctx                  ; optional: the sender's trace, re-established
   :reply       promise}             ; optional: rides through to the render

Plain data: no Ring request. `adapters.handlers.request/->event-msg` builds
one from a request; `server-event` builds one for a server event.

BETWEEN the controller and the :invoke proc (over the controller's
`:to-invoke` / `:from-invoke` ports): the incoming message with the ctx
being stepped, plus `:invoke` on the way out and the raised event on the
way back. Any other key rides along, `:mulog-ctx` and `:reply` included.

To the view and OUT (on the flow's out-chan): {:event :initial-ctx :ctx …}
with the same `:mulog-ctx` and `:reply`, plus `:html` once the view has
rendered — or an error message when a step threw (`error`, `error-of`). One
per event, or one per step in an `:async?` flow (a connected component's).
Errors travel as messages, never to the flow's error-chan.
raw docstring

errorclj

(error e msg)

The message a proc emits instead of its result when e was thrown while handling msg: keeps the trace and the reply, so the error reaches whoever waits on it.

The message a proc emits instead of its result when `e` was thrown while
handling `msg`: keeps the trace and the reply, so the error reaches whoever
waits on it.
sourceraw docstring

error-ofclj

(error-of msg)

The exception an error message carries, or nil for any other message.

The exception an error message carries, or nil for any other message.
sourceraw docstring

fn-nameclj

(fn-name f)

A readable name for a function object, for trace names: my.app.components.chat.chat_actions$root_init → chat-actions/root-init

A readable name for a function object, for trace names:
my.app.components.chat.chat_actions$root_init → chat-actions/root-init
sourceraw docstring

server-eventclj

(server-event event-name params)

The in-chan message for an event the server sends (no request, no signals); the caller's trace rides along.

The in-chan message for an event the server sends (no request, no
signals); the caller's trace rides along.
sourceraw docstring

with-replyclj

(with-reply out {:keys [reply]})

Carries the incoming message's :reply (if any) onto an outgoing one.

Carries the incoming message's `:reply` (if any) onto an outgoing one.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close