tower
tower copied to clipboard
Way to recover stream from Worker (through Buffer::pair)
Currently, tower_buffer::Buffer::new
returns a SpawnError<T>
, defined like so:
pub struct SpawnError<T> {
inner: T,
}
The T
here is the Service
passed to Buffer::new
. However, there is no way to extract the inner
from SpawnError
, so Buffer::new
's caller has no way to recover the transport on failure.
Buffer::new
no longer returns an error (because tokio::spawn
doesn't), but it should probably be possible to extract the inner Service
(T
) from a Worker<T>
that the user gets from Buffer::pair
.
👍 makes sense
I can take this up.
@srikwit sounds good, let me know if you need any help!