lendup / fs2-blobstore

Minimal, idiomatic, stream-based Scala interface for key/value store implementations
Apache License 2.0
92 stars 26 forks source link

SftpStore doesn't support concurrent writes #51

Closed jgogstad closed 5 years ago

jgogstad commented 5 years ago

The SftpStore is a bit clunky at the moment:

The apply method takes a F[ChannelSftp], but closes more resources than it acquires - it acquires a ChannelSftp, but closes the session as well.

I think closing the session is fine, but we should take a F[Session] then and just manage the channels internally. As it stands now it's impossible to perform concurrent operations on the store, since one channel can handle a single write at a time, and the store only works on one channel. AND if you try to make multiple stores for multiple channels on the client side, the store closes the session.

Maybe make something like:

Since it's blocking IO, making the pool unbounded makes sense.

Any thoughts on this?