spanner: allow moving sessions between clients
We spawn subprocesses that need to perform latency critical spanner queries immediately on startup. One of the impediments to this setup is that creating a spanner session can be a slow operation.
Would it be possible to allow moving sessions from one client to another? Then the parent process could prepare sessions ahead of time and pass them to the subprocess on startup. I.e., take Session protos holding the session name from the parent process spanner client then serialize and pass them to the subprocess which would then deserialize and pass them in when creating a new spanner client.
Since the Spanner session itself becomes a simple struct, you can perform any operation using that string. However, the requested behavior goes beyond the scope of the library, so you'll need to manually copy and manage it yourself.
https://github.com/yoshidan/google-cloud-rust/blob/4637c081f43a455195ffd52703b7aaf99c198cbd/spanner/src/session.rs#L26C18-L26C25