Liking cljdoc? Tell your friends :D

monkey.mailman.core


EventPostercljprotocol

Sends events to a broker.

Sends events to a broker.

post-eventsclj

(post-events this events)

Posts one or more events

Posts one or more events
raw docstring

EventReceivercljprotocol

Receives events from a broker, either by polling or by registering a listener.

Receives events from a broker, either by polling or by registering a listener.

add-listenerclj

(add-listener this listener)

Registers a listener to receive incoming events

Registers a listener to receive incoming events

poll-eventsclj

(poll-events this n)

Returns up to n pending events, using pull model. If n is nil, returns all pending events.

Returns up to `n` pending events, using pull model.  If `n` is `nil`, returns all
pending events.
raw docstring

handler->fnclj

(handler->fn handler)

Converts the handler into an invokable function that applies interceptors

Converts the handler into an invokable function that applies interceptors
raw docstring

Listenercljprotocol

A listener is returned when adding a listener to a broker. It's usually broker implementation specific and allows to unregister the listener.

A listener is returned when adding a listener to a broker.  It's usually broker
implementation specific and allows to unregister the listener.

invoke-listenerclj

(invoke-listener this evt)

Invokes this listener with the given event

Invokes this listener with the given event

unregister-listenerclj

(unregister-listener this)

Unregisters the listener from the event receiver it was previously added to.
Returns true if it was succesfully unregistered.

Unregisters the listener from the event receiver it was previously added to.  
Returns `true` if it was succesfully unregistered.
raw docstring

make-routerclj

(make-router routes & [{:keys [interceptors] :as opts}])

Creates an event router object. It can be registered as a listener and it will route events according to the route configuration. The router returns a structure holding the processed event, the handler, and the handler return value for each of the matched handlers. If no handlers are found, returns nil.

An extra options map can be passed in to override default behaviour:

  • :matcher: function that determines the handlers to invoke for an event, defaults to type-matcher.
  • :invoker: function that performs handler invocation. By default this is the sync-invoker.
  • :interceptors: custom interceptors, prepended to the route-specific interceptors.
Creates an event router object.  It can be registered as a listener and it will
route events according to the route configuration.  The router returns a structure
holding the processed event, the handler, and the handler return value for each
of the matched handlers.  If no handlers are found, returns `nil`.

An extra options map can be passed in to override default behaviour:
  - `:matcher`: function that determines the handlers to invoke for an event, defaults to `type-matcher`.
  - `:invoker`: function that performs handler invocation.  By default this is the `sync-invoker`.
  - `:interceptors`: custom interceptors, prepended to the route-specific interceptors.
raw docstring

poll-nextclj

(poll-next e)

Polls for next event from the receiver

Polls for next event from the receiver
raw docstring

replace-interceptorsclj

(replace-interceptors router replacements)

Creates a new router with the given interceptors replaced. The interceptors with the same :name are replaced by the ones in the replacement collection. This is useful in tests when you want to 'mock out' certain side-effecting interceptors.

Creates a new router with the given interceptors replaced.  The interceptors with 
the same `:name` are replaced by the ones in the replacement collection.  This is
useful in tests when you want to 'mock out' certain side-effecting interceptors.
raw docstring

RouteMatchercljprotocol

Used by the router to find handlers for an incoming event.

Used by the router to find handlers for an incoming event.

compile-routesclj

(compile-routes this routes)

Compiles routes in a format that is more suitable for the matcher

Compiles routes in a format that is more suitable for the matcher

find-handlersclj

(find-handlers this routes evt)

Checks if this matches given event

Checks if this matches given event
raw docstring

routerclj

Alias for make-router

Alias for `make-router`
raw docstring

sync-invokerclj

(sync-invoker handlers evt)

Handler invoker that invokes each of the handlers in sequence.

Handler invoker that invokes each of the handlers in sequence.
raw docstring

ToHandlercljprotocol

Converts the object into an event handler fn.

Converts the object into an event handler fn.

->handlerclj

(->handler this)

Converts this to a handler

Converts this to a handler
raw docstring

type-matcherclj

Handler matcher that assumes routes is a map and that matches by event type

Handler matcher that assumes routes is a map and that matches by event type
raw docstring

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

× close