Skip to content
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

Merged
merged 4 commits into from
Sep 8, 2017

Conversation

alexvaluyskiy
Copy link
Contributor

@alexvaluyskiy alexvaluyskiy commented Sep 7, 2017

Scala JVM has RestartSource, RestartSink and RestartFlow, which is not implemented in Akka.NET at the moment
Fixed #3086

{
if (exception is ArithmeticException)
return new Option<string>("stream truncated");
return Option<string>.None;
Copy link
Contributor Author

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?

Copy link
Contributor

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).

Copy link
Contributor

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.

Copy link
Contributor Author

@alexvaluyskiy alexvaluyskiy Sep 7, 2017

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?

Copy link
Contributor

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

Copy link
Contributor Author

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).
Copy link
Contributor Author

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).
Copy link
Contributor Author

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)).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed the link

@alexvaluyskiy alexvaluyskiy changed the title Improved error-handling page Improved Streams Error-Handling docs Sep 7, 2017
@marcpiechura marcpiechura merged commit 9288b53 into akkadotnet:dev Sep 8, 2017
@alexvaluyskiy alexvaluyskiy deleted the streamsdocs branch September 8, 2017 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants