-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved Streams Error-Handling docs #3085
Conversation
{ | ||
if (exception is ArithmeticException) | ||
return new Option<string>("stream truncated"); | ||
return Option<string>.None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Silv3rcircl3 I wondered that we have such API. Why not just string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option<>
is like Nullable<>
, but it can also work with non-value types. We needed a universal primitive that will notify about value absence and will work with both (classes and structs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that NULL is not allowed as element, so return null would fail the stream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Silv3rcircl3 Is null accepted in RecoveryWithRetries
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, because there you return a complete new source and null indicates that you don't want to recover but rather fail the stream. By element I mean a single message that is processed by the stream, i.e. Select(x => null as string) would fail the stream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks
elements that cause the division by zero are effectively dropped. | ||
|
||
> [!NOTE] | ||
> Be aware that dropping elements may result in deadlocks in graphs with cycles, as explained in [Graph cycles, liveness and deadlocks](workingwithgraphs#graph-cycles-liveness-and-deadlocks). | ||
> Be aware that dropping elements may result in deadlocks in graphs with cycles, as explained in [Graph cycles, liveness and deadlocks](xref:working-with-graphs#graph-cycles-liveness-and-deadlocks). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed the link
@@ -518,7 +518,7 @@ Please note that a factory is necessary to achieve reusability of the resulting | |||
|
|||
As described above any Akka Streams ``Source`` can be exposed as a Reactive Streams ``Publisher`` | |||
and any ``Sink`` can be exposed as a Reactive Streams ``Subscriber``. Therefore we recommend that you | |||
implement Reactive Streams integrations with built-in stages or [custom stages](customstreamprocessing.md). | |||
implement Reactive Streams integrations with built-in stages or [custom stages](xref:custom-stream-processing). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the link
@@ -509,7 +509,7 @@ public static IMessage FromBytes(ByteString bytes) | |||
|
|||
In this way you could easily integrate any other serialization library that turns an object into a sequence of bytes. | |||
|
|||
The other stage that we talked about is a little more involved since reversing a framing protocol means that any received chunk of bytes may correspond to zero or more messages. This is best implemented using a `GraphStage` (see also [Custom processing with GraphStage](customstreamprocessing.md#custom-processing-with-graphstage)). | |||
The other stage that we talked about is a little more involved since reversing a framing protocol means that any received chunk of bytes may correspond to zero or more messages. This is best implemented using a `GraphStage` (see also [Custom processing with GraphStage](xref:custom-stream-processing#custom-processing-with-graphstage)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed the link
Scala JVM has
RestartSource
,RestartSink
andRestartFlow
, which is not implemented in Akka.NET at the momentFixed #3086