-
Notifications
You must be signed in to change notification settings - Fork 10
Add some flags to example, fix version issue #127
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
Conversation
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. |
} | ||
Sink<String>? logSink; | ||
logFile.createSync(recursive: true); | ||
final fileByteSink = logFile.openWrite( |
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.
Just to confirm, this will actually write the bytes to disk relatively quickly when we write to the sink? Do we need to call flush
or anything?
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.
Hmm. It will be buffered by default, but I guess we do want it to be pretty up-to-date. I don't think I can turn off the buffering on the file descriptor. I added a call to flush each time something is added to the sink.
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.
When I did this previously I just did regular writes in append mode for each line that came in, instead of keeping it open like this. In theory this is better though, but we do want to actually see the logs.
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.
Flushing should do that, and this is only in the example.
I did look at doing the flush
where we do the adding to the sink in the main package, but then we'd have to change the Sink<String>
to an IOSink
, since the base Sink
doesn't have flush()
, which would be a breaking change.
LGTM with some final nits |
FYI, @jakemac53 I don't have permissions to submit the PR, so just submit when you're happy with it. |
Description
Adds
--help
,--log
, and--model
flags to the workflow example and fixes a problem where the examples would only connect to servers with the latest protocol version (instead of any supported version).