tower icon indicating copy to clipboard operation
tower copied to clipboard

Way to recover stream from Worker (through Buffer::pair)

Open jonhoo opened this issue 5 years ago • 4 comments

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.

jonhoo avatar Oct 17 '18 17:10 jonhoo

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.

jonhoo avatar Mar 31 '20 22:03 jonhoo

👍 makes sense

LucioFranco avatar Apr 21 '20 21:04 LucioFranco

I can take this up.

srikwit avatar Apr 21 '20 22:04 srikwit

@srikwit sounds good, let me know if you need any help!

LucioFranco avatar Apr 21 '20 23:04 LucioFranco