You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Copyright (C) 2023 Lightbend Inc. <https://www.lightbend.com>
3
+
*/
4
+
5
+
packageakka.stream.javadsl
6
+
7
+
importakka.NotUsed
8
+
importakka.japi.function.Creator
9
+
importakka.stream.RestartSettings
10
+
importakka.stream.scaladsl
11
+
12
+
/**
13
+
* A RestartSourceWithContext wraps a [[SourceWithContext]] that gets restarted when it completes or fails.
14
+
*
15
+
* They are useful for graphs that need to run for longer than the [[SourceWithContext]] can necessarily guarantee it will,
16
+
* e.g. for [[SourceWithContext]] streams that depend on a remote service to which connectivity may be lost (crash or partition). The RestartSourceWithContext ensures that the graph can continue running while the SourceWithContext restarts.
17
+
*/
18
+
objectRestartSourceWithContext {
19
+
20
+
/**
21
+
* Wrap the given [[SourceWithContext]] with a SourceWithContext that will restart it when it fails or completes using an exponential backoff.
22
+
*
23
+
* The returned [[SourceWithContext]] will not emit a complete or failure as long as maxRestarts is not reached, since the completion or failure of the wrapped SourceWithContext is handled by restarting it. The wrapped SourceWithContext can however be canceled by canceling the returned SourceWithContext. When that happens, the wrapped SourceWithContext will be canceled and will not be restarted.
24
+
*
25
+
* @paramsettings [[RestartSettings]] defining the restart configuration
26
+
* @paramsourceFactory A factory for producing the SourceWithContext to wrap
* Wrap the given [[SourceWithContext]] with a SourceWithContext that will restart it when it fails using an exponential backoff.
37
+
*
38
+
* The returned [[SourceWithContext]] will not emit a failure as long as maxRestarts is not reached, since the failure of the wrapped SourceWithContext is handled by restarting it. The wrapped SourceWithContext can however be canceled by canceling the returned SourceWithContext. When that happens, the wrapped SourceWithContext if currently running will be canceled and will not be restarted.
39
+
*
40
+
* @paramsettings [[RestartSettings]] defining the restart configuration
41
+
* @paramsourceFactory A factory for producing the SourceWithContext to wrap
* Copyright (C) 2023 Lightbend Inc. <https://www.lightbend.com>
3
+
*/
4
+
5
+
packageakka.stream.scaladsl
6
+
7
+
importakka.NotUsed
8
+
importakka.stream.RestartSettings
9
+
10
+
/**
11
+
* A RestartSourceWithContext wraps a [[SourceWithContext]] that gets restarted when it completes or fails.
12
+
*
13
+
* They are useful for graphs that need to run for longer than the [[SourceWithContext]] can necessarily guarantee it will,
14
+
* e.g. for [[SourceWithContext]] streams that depend on a remote service to which connectivity may be lost (crash or partition). The RestartSourceWithContext ensures that the graph can continue running while the [[SourceWithContext]] restarts.
15
+
*/
16
+
objectRestartSourceWithContext {
17
+
18
+
/**
19
+
* Wrap the given [[SourceWithContext]] with a [[SourceWithContext]] that will restart it when it fails or completes using an exponential backoff.
20
+
*
21
+
* The returned [[SourceWithContext]] will not emit a complete or failure as long as maxRestarts is not reached, since the completion or failure of the wrapped [[SourceWithContext]] is handled by restarting it. The wrapped [[SourceWithContext]] can however be canceled by canceling the returned [[SourceWithContext]]. When that happens, the wrapped [[SourceWithContext]] if currently running will be canceled and will not be restarted.
* Wrap the given [[SourceWithContext]] with a [[SourceWithContext]] that will restart it when it fails using an exponential backoff.
35
+
*
36
+
* The returned [[SourceWithContext]] will not emit a failure as long as maxRestarts is not reached, since the failure of the wrapped [[SourceWithContext]] is handled by restarting it. The wrapped [[SourceWithContext]] can however be canceled by canceling the returned [[SourceWithContext]]. When that happens, the wrapped [[SourceWithContext]] if currently running will be canceled and will not be restarted.
0 commit comments