Skip to content
Permalink
526cdc58d6
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
49 lines (48 sloc) 2.04 KB
(ns overseer.component.endpoints-session-superuser
(:require [clojure.tools.logging :refer [info error]]
[clojure.core.async :as async]
[com.stuartsierra.component :as component]
[datascript.core :as d]
[de.mpg.shh.util-message-server.helpers :as message-helpers]
[de.mpg.shh.util-overseer.server :as overseer-server]
[overseer.utils :as utils]))
(defrecord EndpointsSessionSuperUser [request-channel overseer-conn hostname rx-config-list tx-config-list]
component/Lifecycle
(start [this]
(let [receive (fn [destination data]
(try
(overseer-server/receive overseer-conn (assoc data :destination destination))
(catch Throwable t
(error "failed to receive '" (pr-str destination) "' message " (pr-str data) " " (utils/stack-trace-to-string t)))))]
{
:error
(fn [request-channel message]
(error "error endpoint received: " message))
:workflow-create
(fn [request-channel {data :data :as message}]
(receive :workflow-create data))
:workflow-play
(fn [request-channel {data :data :as message}]
(receive :workflow-play data))
:workflow-pause
(fn [request-channel {data :data :as message}]
(receive :workflow-pause data))
:workflow-clear-failed
(fn [request-channel {data :data :as message}]
(receive :workflow-clear-failed data))
:workflow-clear-all
(fn [request-channel {data :data :as message}]
(receive :workflow-clear-all data))
:workflow-restart-from-step
(fn [request-channel {data :data :as message}]
(receive :workflow-restart-from-step data))
:resource-toggle-backup
(fn [request-channel {data :data :as message}]
(receive :resource-toggle-backup data))
:overseer-synch-scheduler
(fn [request-channel {data :data :as message}]
(receive :overseer-synch-scheduler data))
:overseer-synch-transaction
(fn [request-channel {data :data :as message}]
(receive :overseer-synch-transaction data))
})))