Created
November 4, 2015 18:17
-
-
Save Samstiles/d9732b4582066f04da29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns stats-service.domain.protocols | |
"Protocols used throughout the stats service." | |
(:refer-clojure :exclude [name]) | |
(:require [co.paralleluniverse.pulsar.core :as a])) | |
(defprotocol Statistic | |
"Base statistic from which all other statistics are derived." | |
(name [this] "Returns the name of this Statistic. Will be used by the Actor to update its map of Records when the Record changes") | |
(context [this] "Returns the context for the Statistic (Interaction, Resource, Queue)") | |
(event-set [this] "Returns the set of events that this Statistic cares about") | |
(receive [this event] "Receive an event. Returns a Vector with an updated version of this record and any generated reporting events") | |
(finished? [this] "Am I still waiting for any events?") | |
(serialize [this] "Generate a representation that is persistable")) | |
(a/suspendable! stats_service.domain.protocols.Statistic) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment