-
Notifications
You must be signed in to change notification settings - Fork 10
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
Adds support for AsyncStream #4
Conversation
@petershaw Any interest in taking this change? |
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.
I'm in favor of offering a stream to consume events.
What would you think about a method that returns the stream (and sets an optional continuation member) rather than initialing the stream by default?
Thanks for adding this and sorry for the late reply, somehow we missed it... We will have a look and get back to you, soon! |
Hey @mcritz I'll manage to take a look to the implementation at the beginning of next week. |
Swift 5.9 is a minimum requirement.
On Linux the |
@mcritz I split test into two and fixed the problem. |
@KrisSimon Thanks for fixing that. Happy to have made a contribution! |
@mcritz thank you very much for your contribution. |
This PR:
AsyncStream
support toFileMonitor
for modern Swift Structured Concurrency supportBenefits:
Users can change callback based system with
for await event in fileMonitor.stream { ... }
Drawbacks:
I have forced the Package to use Swift 5.9 instead of using
#available
or@available
. We could use an availability check to avoid breaking backward compatibility. OR we could release a new, breaking release of this Package using Github releases.I’m open to either approach, but we should pick one.