Random utils, bot abstraction.
Random utils, bot abstraction.
(generic-control bot-session f wrk req handler-args)
Common tasks which any bot should support.
Common tasks which any bot should support.
(generic-data-handler data bot-session)
Handles additional data which are a result of a request. It's like side effect for the request, regardless of its reply. When session object is returned then bot-specific data handlers should not interfere (processing is done) and just replace session with the returned one. When nil is returned then bot-specific data handlers should exit the loop and finish execution. All other data is passed as is.
Handles additional data which are a result of a request. It's like side effect for the request, regardless of its reply. When session object is returned then bot-specific data handlers should not interfere (processing is done) and just replace session with the returned one. When nil is returned then bot-specific data handlers should exit the loop and finish execution. All other data is passed as is.
(handle-request bot-session f data-handler wrk req & handler-args)
Handles requests. Returns an Outcome object. Passes control to a chosen request handler f to prepare the response. Updates the returned map with data-handler if data is present in the outcome.
Handles requests. Returns an Outcome object. Passes control to a chosen request handler f to prepare the response. Updates the returned map with data-handler if data is present in the outcome.
(instance-config cfg instance-id)
Creates an instance of a configuration for the given instance (if a bot is instantiable).
Creates an instance of a configuration for the given instance (if a bot is instantiable).
(run! wrk)
(run! bot-session cfg)
(run! bot-session cfg instance)
Runs a bot by creating a worker thread with communication channels. After bot is successfully created it queries it for its updated configuration and replaces a local one with it.
Runs a bot by creating a worker thread with communication channels. After bot is successfully created it queries it for its updated configuration and replaces a local one with it.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close