-
Notifications
You must be signed in to change notification settings - Fork 54
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 support for more flexible backend streams #9
Comments
This is something that I would love to see implemented. It would do wonders for a project that I was participating on that was more or less abandoned a while ago because of difficulties with this and related issues. I'd also be willing to participate if I can be of any help. |
Great! I don't have a strong preference as to which approach is taken. I also don't have time to work on this myself right now, so I'm going to be especially appreciative of anyone who wants to take this on. :) With that said, the |
@jtdaugherty It seems that converting to
Similarly, I constructed
for TLS contexts from One problem is that it doesn't really make sense to close a conduit. Another conduit can be appended after it and continue its processing. This can be also viewed as that closing a connection is the responsibility of whoever created it, not IMAP's. So currently for conduits With this structure, I think we could
|
I think having a separate integration package like |
…tream instead of just IO. see jtdaugherty#11 and jtdaugherty#9
I wanted to use IMAP with TLS and this turned out to be quite complex. (Relates to #7.) So far, I found these solutions:
Use threads - one for wrapping a connection into TLS and another for the actual IMAP handling. This is awful.
Use
MonadIO
instead ofIO
everywhere. I already tried this variant in this branch for IMAP. It seems to work well and I was able to fuse such patched IMAP with network-conduit. The main part looks like this:Here
BSStreamM
is a (backward compatible) modification that takes an arbitraryMonadIO
instead ofIO
. This allows us to run the whole code inConduit
instead ofIO
and so the actions inBSStreamM
can be operations constructed usingConduit
primitives. (Full example code here).This modification adds generality and the only loss is slightly more complex type signatures.
Modify HaskellNet so that it's based on conduit instead of
IO
. I don't have a clear picture yet. The general idea is that connection wouldn't hold aBSStream
but aSink
for network output and aResumableSource
for network input. This would allow to plug in any conduit, even a pure one (for testing, for example).I'm willing to participate on those changes, if we reach some consensus.
The text was updated successfully, but these errors were encountered: