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

Add flush feature into Akka.Streams.Implementation.IO.FileSubscriber #4859

Conversation

Arkatufus
Copy link
Contributor

Closes #4851

Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

LGTM

/// <returns>TBD</returns>
public static Sink<ByteString, Task<IOResult>> ToFile(FileInfo f, FileMode? fileMode = null, long startPosition = 0) =>
public static Sink<ByteString, Task<IOResult>> ToFile(FileInfo f, FileMode? fileMode = null, long startPosition = 0, bool autoFlush = false) =>
Copy link
Member

Choose a reason for hiding this comment

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

LGTM

_bytesWritten += bytes.Length;
if(_autoFlush)
Copy link
Member

Choose a reason for hiding this comment

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

LGTM

.WasHandled;
return true;

case var msg when _flushCommand != null && ReferenceEquals(_flushCommand, msg):
Copy link
Member

Choose a reason for hiding this comment

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

Note - need to add an issue to make this programmable from the outside - i.e. a flow stage that can send a Flush signal to the FileSubscriberActor.

@Aaronontheweb Aaronontheweb merged commit b3f9f4c into akkadotnet:dev Mar 23, 2021
@Arkatufus Arkatufus deleted the STREAM_Add_flush_feature_to_FileSubscriber branch February 27, 2023 17:25
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.

Akka.Streams: FileIO sinks don't flush until completed
2 participants