-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: implement RetryableFuture on XSNServiceRPCImpl
- Loading branch information
1 parent
a549b74
commit 885c7d5
Showing
6 changed files
with
442 additions
and
194 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.xsn.explorer.config | ||
|
||
import scala.concurrent.duration.FiniteDuration | ||
|
||
case class RetryConfig(initialDelay: FiniteDuration, maxDelay: FiniteDuration) |
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
22 changes: 22 additions & 0 deletions
22
server/app/com/xsn/explorer/modules/RetryableFutureModule.scala
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,22 @@ | ||
package com.xsn.explorer.modules | ||
|
||
import akka.actor.{ActorSystem, Scheduler} | ||
import com.google.inject.{AbstractModule, Provides} | ||
import com.xsn.explorer.config.RetryConfig | ||
|
||
import scala.concurrent.duration._ | ||
|
||
class RetryableFutureModule extends AbstractModule { | ||
|
||
override def configure(): Unit = {} | ||
|
||
@Provides | ||
def retryConfig(): RetryConfig = { | ||
RetryConfig(1.second, 65.seconds) | ||
} | ||
|
||
@Provides | ||
def scheduler(actorSystem: ActorSystem): Scheduler = { | ||
actorSystem.scheduler | ||
} | ||
} |
Oops, something went wrong.