Hello, it is possible do parallel filter via colle...
# announcements
a
Hello, it is possible do parallel filter via collection stream?
g
Are you talking about Java streams?
There is parallel() operator for java streams
k
a
Okey, thx guys. I think mb in kotlin we have another way for it)
k
Another way is to use sequences, which is more idiomatic to Kotlin (or so I think), and achieves the same function as streams
g
If you use java streams there is no other way. You can achieve it using coroutines
Kotlin sequences is syncronous only abstraction, there is no way to make it parallel, at least in some easy way without some fork-join abstraction
a
Andrey, some samples? How i can make it with coroutines? Interesting
g
Depends on your case, there are different ways, I would recommend to check coroutines guides first
a
Okay, thx now i have some ideas)
g
Just want to mention that Flow is not the only way, but yes Flow is most suitable abstraction for this. But again, I would recommend to read official guides first, to have understanding of coroutines