aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/core/messaging/Bus.scala
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2018-09-10 15:10:09 -0700
committerGitHub <noreply@github.com>2018-09-10 15:10:09 -0700
commitf07bee564b11ee76fd065ec849a888bcf4e74e85 (patch)
tree538330c7592ccd4f555a07bf03aa91cace403be5 /src/main/scala/xyz/driver/core/messaging/Bus.scala
parent93ffc0a5c4b54a8beea10c3fd68e7a2d70c4c771 (diff)
downloaddriver-core-f07bee564b11ee76fd065ec849a888bcf4e74e85.tar.gz
driver-core-f07bee564b11ee76fd065ec849a888bcf4e74e85.tar.bz2
driver-core-f07bee564b11ee76fd065ec849a888bcf4e74e85.zip
Various message bus fixes (#212)v1.14.0
1. Move to pure mixin-based ("stackable traits") pattern. 2. Provide a "CreateOnDemand" mixin that ensures topics and subscriptions have been created before they are used.
Diffstat (limited to 'src/main/scala/xyz/driver/core/messaging/Bus.scala')
-rw-r--r--src/main/scala/xyz/driver/core/messaging/Bus.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/scala/xyz/driver/core/messaging/Bus.scala b/src/main/scala/xyz/driver/core/messaging/Bus.scala
index 599af92..75954f4 100644
--- a/src/main/scala/xyz/driver/core/messaging/Bus.scala
+++ b/src/main/scala/xyz/driver/core/messaging/Bus.scala
@@ -16,7 +16,7 @@ trait Bus {
/** Most general kind of message. Any implementation of a message bus must provide
* the fields and methods specified in this trait. */
- trait BasicMessage[A] {
+ trait BasicMessage[A] { self: Message[A] =>
/** All messages must have unique IDs so that they can be acknowledged unambiguously. */
def id: MessageId
@@ -41,6 +41,9 @@ trait Bus {
/** Maximum amount of messages handled in a single retrieval call. */
val defaultMaxMessages = 64
+ /** Execution context that is used to query and dispatch messages from this bus. */
+ implicit val executionContext: ExecutionContext
+
/** Retrieve any new messages in the mailbox of a subscription.
*
* Any retrieved messages become "outstanding" and should not be returned by this function