Liking cljdoc? Tell your friends :D

discljord.events

Functions for getting events off of a queue and processing them.

Functions for getting events off of a queue and processing them.
raw docstring

dispatch-handlersclj

(dispatch-handlers handlers event-type event-data & args)

Calls event handlers from handlers with the event and args.

The handlers argument is a map from a keyword event type to a vector of event handler functions (with additional arguments filled by args) to be run in sequence.

Calls event handlers from `handlers` with the event and `args`.

The `handlers` argument is a map from a keyword event type to a vector of
event handler functions (with additional arguments filled by `args`) to be run
in sequence.
sourceraw docstring

message-pump!clj

(message-pump! event-ch handle-event)

Starts a process which pulls events off of the channel and calls handle-event with them, and stops when it sees a :disconnect event. This takes control of the current thread.

The handle-event function takes the keyword event type, and the event data.

Starts a process which pulls events off of the channel and calls
handle-event with them, and stops when it sees a :disconnect event.
This takes control of the current thread.

The handle-event function takes the keyword event type, and the event
data.
sourceraw docstring

normalize-handlersclj

(normalize-handlers handlers)

Constructs a handlers map for dispatch-handlers, allowing sets for keys.

Keyword keys are kept as-is, but sets will be split into their members to allow keying the handler map off of a single event type. This is done in an undefined order, so duplicate keys have an undefined precidence.

Constructs a `handlers` map for [[dispatch-handlers]], allowing sets for keys.

Keyword keys are kept as-is, but sets will be split into their members to
allow keying the handler map off of a single event type. This is done in an
undefined order, so duplicate keys have an undefined precidence.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close