     (subscribed-data [_ event]
       (api/services-memo))))
 
-(def task-container-event
+(def service-info-by-name-container-event
+  (reify Rule
+    (match? [_ event]
+      (service-container-event? event))
+    (subscription [_ event]
+      (let [service-name (get-in event [:Actor :Attributes :com.docker.swarm.service.name])]
+        {:handler :service-info
+         :params  {:id service-name}}))
+    (subscribed-data [_ event]
+      (service-info-data event))))
+
+(def service-info-by-id-container-event
+  (reify Rule
+    (match? [_ event]
+      (service-container-event? event))
+    (subscription [_ event]
+      (let [service-id (get-in event [:Actor :Attributes :com.docker.swarm.service.id])]
+        {:handler :service-info
+         :params  {:id service-id}}))
+    (subscribed-data [_ event]
+      (service-info-data event))))
+
+(def task-list-container-event
   (reify Rule
     (match? [_ event]
       (service-container-event? event))

    (subscribed-data [_ event]
      (api/tasks-memo))))

(def service-event
  (reify Rule
    (match? [_ event]
      (= "service" (:Type event)))

         (some? service-id)
         (contains? supported-actions (:Action event)))))

(defn- service-info-data
  [event]
  (let [service-id (get-in event [:Actor :Attributes :com.docker.swarm.service.id])
        service (api/service service-id)
        tasks (api/service-tasks service-id)
        networks (api/service-networks service-id)]
    {:service  service
     :tasks    tasks
     :networks networks}))

(def service-list-container-event
  (reify Rule
    (match? [_ event]
      (service-container-event? event))
