# Are there any best practices on how to avoid cycles in streams?

**URL:** https://discuss.akka.io/t/are-there-any-best-practices-on-how-to-avoid-cycles-in-streams/3702
**Category:** Akka Libraries
**Tags:** streams
**Created:** [March 19, 2019, 2:38am UTC](https://discuss.akka.io/t/are-there-any-best-practices-on-how-to-avoid-cycles-in-streams/3702 "2019-03-19T02:38:10Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![SSopin](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@SSopin](https://discuss.akka.io/u/SSopin)
#### Post date: [March 19, 2019, 1:03pm UTC](https://discuss.akka.io/t/are-there-any-best-practices-on-how-to-avoid-cycles-in-streams/3702/3 "2019-03-19T13:03:21Z")

</div>

Hi Martynas,

Thank you very much! Yes, I have seen the documentation. In my case it was not pure deadlock, but eagerComplete configuration. When I set it to false my flow never ends, but when it is true it seems to be ending earlier than it should.

I was even thinking about streaming “loop” data into a separate Sink, then convert it into a source like explained here: [Create Source from Sink (and vice versa)](https://discuss.akka.io/t/create-source-from-sink-and-vice-versa/605) and merge newly created Source with the initial one. In this case I will have less problems with back-pressure and eagerComplete.

– Sergii

---

_[View the full topic](https://discuss.akka.io/t/are-there-any-best-practices-on-how-to-avoid-cycles-in-streams/3702)._
