filesystem_spec icon indicating copy to clipboard operation
filesystem_spec copied to clipboard

spec: add sync/async connect/disconnect

Open efiop opened this issue 3 years ago • 0 comments

From discussion in #864

Currently, fsspec doesn't define any connect/disconnect methods in sync or async specs, which results in some implementations implementing things like set_session/connect/etc or even simply creating a connection automatically and using weakref to close it.

This issue is meant to try to start the discussion about the proper common API that all implementations could comply with.

  1. connect/disconnect (possible better names?) with async versions

  2. sync and async context managers?

  3. clearly automatic connection is a very handy thing and most of filesystems already do it. Please correct me if I'm wrong, but it looks like this is not documented (but I'm not sure if it even needs to be, since it is kinda given from the examples).

  4. a bit unrelated, but we currently use _ prefix for async methods, which looks unofficial to users and linters 🙂 Maybe time to also support async_ to make it official?

efiop avatar Dec 20 '21 20:12 efiop