# Function futures::unsync::mpsc::spawn_unbounded [−] [src]

    pub fn spawn_unbounded<S, E>(
        stream: S,
        executor: &E
    ) -> SpawnHandle<S::Item, S::Error> where
        S: Stream,
        E: Executor<Execute<S>>,

Spawns a `stream` onto the instance of `Executor` provided, `executor`, returning a handle representing the remote stream, with unbounded buffering.

The `stream` will be canceled if the `SpawnHandle` is dropped.

The `SpawnHandle` returned is a stream that is a proxy for `stream` itself. When `stream` has additional items available, then the `SpawnHandle` will have those same items available.

An unbounded buffer is used, which means that values will be buffered as fast as `stream` can produce them, without any backpressure. Therefore, if `stream` is an infinite stream, it can use an unbounded amount of memory, and potentially hog CPU resources. In particular, if `stream` is infinite and doesn't ever yield (by returning `Async::NotReady` from `poll`), it will result in an infinite loop.

# Panics

This function will panic if `executor` is unable spawn a `Future` containing the entirety of the `stream`.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)