Repository navigation
Mailbox selection for Akka Typed actors - #27183
johanandren merged 8 commits into
Conversation
|
Test FAILed. |
| // mailbox configurators for the same size | ||
| val capacity = id.split(':')(1).toInt | ||
| new BoundedMailbox(capacity, Duration.Zero) | ||
|
|
There was a problem hiding this comment.
Not exactly my proudest moment encoding this in strings but allowed for minimal changes in untyped + caching of the configurator.
There was a problem hiding this comment.
The caching argument is good. I think it's ok.
|
Test FAILed. |
| // mailbox configurators for the same size | ||
| val capacity = id.split(':')(1).toInt | ||
| new BoundedMailbox(capacity, Duration.Zero) | ||
|
|
There was a problem hiding this comment.
The caching argument is good. I think it's ok.
|
Test FAILed. |
Co-Authored-By: Helena Edelson <helena@users.noreply.github.com>
ea46524 to
f6d24db
Compare
|
Test PASSed. |
patriknw
left a comment
There was a problem hiding this comment.
LGTM, with some minor nits
|
Test PASSed. |
| /** | ||
| * Scala API: The default mailbox is unbounded and backed by a [[java.util.concurrent.ConcurrentLinkedQueue]] | ||
| */ | ||
| def default(): MailboxSelector = DefaultMailboxSelector.empty |
There was a problem hiding this comment.
Does it need parentheses for the Scala version?
There was a problem hiding this comment.
Hmm, maybe not, on the fence, on one hand it is a constant/no side effect on the other hand maybe that fact is an implementation detail. This is aligned with the dispatcher selector though.
| @@ -202,8 +206,14 @@ private[akka] class Mailboxes( | |||
| // It doesn't matter if we create a mailbox type configurator that isn't used due to concurrent lookup. | |||
| val newConfigurator = id match { | |||
| // TODO RK remove these two for Akka 2.3 | |||
There was a problem hiding this comment.
Woops, that TODO slipped it seems...
| case _ if id.startsWith(BoundedCapacityPrefix) => | ||
| // hack to allow programmatic set of capacity through props in akka-typed but still share | ||
| // mailbox configurators for the same size | ||
| val capacity = id.split(':')(1).toInt |
There was a problem hiding this comment.
I guess it's ok for us if that fails with a cryptic exception in case we or someone else doesn't follow the format.
There was a problem hiding this comment.
Yeah, it's not public API in any way
…ter/PropsAdapter.scala Co-Authored-By: Johannes Rudolph <johannes.rudolph@gmail.com>
|
Test PASSed. |
Purpose
Allow for selection of mailbox type in Akka Typed through
PropsReferences
Fixes #27124
Changes
New API
MailboxSelector, support inPropsAdapter, hack inakka-actorto allow for programmatic passing of bounded mailbox capacity from typed.