My original choice of having Client implement AsyncStorageConnection and StorageConnection caused a user to spend extra time debugging a problem due to a deadlock caused by using a call from StorageConnection in an async context. The local and server crates actively prevent this by having types that don't implement both traits.
We should add four new types: RemoteServer, AsyncRemoteServer, RemoteDatabase, AsyncRemoteDatabase. Each of these types should only implement one set of traits. Easy functions to convert between the types should be supported. Internally, these all should just wrap Client.
Additional builder methods can be provided to immediately return a specific type -- e.g., build_async()
My original choice of having
Client
implementAsyncStorageConnection
andStorageConnection
caused a user to spend extra time debugging a problem due to a deadlock caused by using a call from StorageConnection in an async context. The local and server crates actively prevent this by having types that don't implement both traits.We should add four new types: RemoteServer, AsyncRemoteServer, RemoteDatabase, AsyncRemoteDatabase. Each of these types should only implement one set of traits. Easy functions to convert between the types should be supported. Internally, these all should just wrap Client.
Additional builder methods can be provided to immediately return a specific type -- e.g.,
build_async()