Skip to content

Conversation

@mpilquist
Copy link
Member

Fixes #772.

If we're good with this overall approach, TCP/UDP sockets should get a similar treatment. Specifically, we should not expose a close method on FileHandle/Socket/etc. and instead, return a Cancellable[F,Resource] from pulls.

@gpampara
Copy link

Regarding the FileHandle usage, it cleans up the API I was using.

@pchlupacek
Copy link
Contributor

@mpilquist my first thought is that TCP sockets have 3 methods in this area (endOfInput, endOfOutput, close), unlike file that has only close. I think we can keep endOfXX like they are and remove close in favor of this pattern.

Generally I don't see any reason to manually invoke close, as there is nothing you can do with socket after being closed.

@mpilquist
Copy link
Member Author

@pchlupacek Agreed on endOfInput / endOfOutput

@mpilquist mpilquist merged commit 64ef511 into typelevel:series/1.0 Feb 15, 2017
@mpilquist mpilquist deleted the topic/cancellable-files branch November 27, 2017 12:42
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.

io.file.pulls should provide constructors which allow early resource cleanup from within Pull

3 participants