# `Electric.ConcurrentStream`
[🔗](https://github.com/electric-sql/electric/tree/%40core/sync-service%401.6.2/packages/sync-service/lib/electric/concurrent_stream.ex#L1)

# `stream_to_end`

Allows concurrent reading while writing of a stream.
There can be mutiple reading processes however there must be only one writing process.

The writing process must append an end marker to the end of the stream when it has finished
to signal to the reading processes that the stream has ended.

If a read process runs out of data to read before the end marker has been written
it waits the `poll_time_in_ms` for more data to be written, then resumes the stream
with the `stream_fun`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
