well-typed / grapesy

Native Haskell gRPC client and server based on `http2`
Other
38 stars 4 forks source link

Long-running connections #77

Closed domenkozar closed 7 months ago

domenkozar commented 7 months ago

Hey, thanks for the awesome work :)

I couldn't find it looking through the source, is there a way to store the Connection pool in a ReaderT that can be used to do the calling?

edsko commented 7 months ago

Hey Domen -- I'm surprised you've found this library before we advertised it in any way at all :) That said, I think it is getting to be pretty complete and stable, but I might still be introducing breaking changes -- but if I do, I suspect they will be minor.

In regards of your question, I guess the library itself doesn't provide such a thing, it's not opinionated on how you want to keep track of the state. That said, there is no reason you couldn't do this yourself, of course. If there is some specific change to the API that would make this easier let me know.

The important thing is that it is definitely supported to keep the Connection around for a long time. In particular, if the connection to the remote node is lost, the Connection will transparently try to reconnect. If that does not happen in particular circumstances, it is a bug and feel free to open a bug report :)

Hope that helps, and let me know how you get on with the library!