-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow passivation from inside the actor (#67)
* Allow passivation from inside the actor * Add support for receive timeout * fmt * Make sure timeout is set in the actor thread + add a test
- Loading branch information
1 parent
b5301ad
commit ed3e3df
Showing
4 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package zio.akka.cluster.sharding | ||
|
||
import scala.concurrent.duration.Duration | ||
import zio.{ Ref, Task, UIO } | ||
|
||
trait Entity[State] { | ||
def replyToSender[R](msg: R): Task[Unit] | ||
def id: String | ||
def state: Ref[Option[State]] | ||
def stop: UIO[Unit] | ||
def passivate: UIO[Unit] | ||
def passivateAfter(duration: Duration): UIO[Unit] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package zio.akka.cluster.sharding | ||
|
||
import scala.concurrent.duration.Duration | ||
|
||
case class SetTimeout(duration: Duration) |
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
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