Make SecretAgent final (sorry James, you knew it couldn't last forever!) and standardised doc comment.
Add `Actor.create` factory method to 2.1->2.1 migration docs
This commit is contained in:
parent
f305ed72a8
commit
df55bc44c9
2 changed files with 6 additions and 3 deletions
|
|
@ -15,14 +15,15 @@ object Agent {
|
|||
def apply[T](initialValue: T)(implicit context: ExecutionContext): Agent[T] = new SecretAgent(initialValue, context)
|
||||
|
||||
/**
|
||||
* Factory method for Java Iterop.
|
||||
* Java API
|
||||
* Factory method for creating an Agent.
|
||||
*/
|
||||
def create[T](initialValue: T, context: ExecutionContext): Agent[T] = Agent(initialValue)(context)
|
||||
|
||||
/**
|
||||
* Default agent implementation.
|
||||
*/
|
||||
private class SecretAgent[T](initialValue: T, context: ExecutionContext) extends Agent[T] {
|
||||
private final class SecretAgent[T](initialValue: T, context: ExecutionContext) extends Agent[T] {
|
||||
private val ref = Ref(initialValue)
|
||||
private val updater = SerializedSuspendableExecutionContext(10)(context)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue