Adding ScalaDoc to EventStream
This commit is contained in:
parent
f566182786
commit
3ac4672ac7
2 changed files with 8 additions and 2 deletions
|
|
@ -116,7 +116,7 @@ trait LookupClassification { this: EventBus ⇒
|
|||
*/
|
||||
trait SubchannelClassification { this: EventBus ⇒
|
||||
|
||||
implicit val subclassification: Subclassification[Classifier]
|
||||
protected implicit def subclassification: Subclassification[Classifier]
|
||||
|
||||
// must be lazy to avoid initialization order problem with subclassification
|
||||
private lazy val subscriptions = new SubclassifiedIndex[Classifier, Subscriber]()
|
||||
|
|
|
|||
|
|
@ -11,12 +11,18 @@ object EventStream {
|
|||
implicit def fromActorSystem(system: ActorSystem) = system.eventStream
|
||||
}
|
||||
|
||||
/**
|
||||
* An Akka EventStream is a pub-sub stream of events both system and user generated,
|
||||
* where subscribers are ActorRefs and the channels are Classes and Events are any java.lang.Object.
|
||||
* EventStreams employ SubchannelClassification, which means that if you listen to a Class,
|
||||
* you'll receive any message that is of that type or a subtype.
|
||||
*/
|
||||
class EventStream(private val debug: Boolean = false) extends LoggingBus with SubchannelClassification {
|
||||
|
||||
type Event = AnyRef
|
||||
type Classifier = Class[_]
|
||||
|
||||
val subclassification = new Subclassification[Class[_]] {
|
||||
protected implicit val subclassification = new Subclassification[Class[_]] {
|
||||
def isEqual(x: Class[_], y: Class[_]) = x == y
|
||||
def isSubclass(x: Class[_], y: Class[_]) = y isAssignableFrom x
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue