6

Talk about mongo, FS2 and reactive streams

 1 year ago
source link: https://yanns.github.io/blog/2021/12/21/fs2-mongo-reactivestreams/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Talk about mongo, FS2 and reactive streams

1 minute read 21 December 2021

At the scala meetup in Berlin, I presented my investigation on how the mongo java driver, reactive streams and FS2 are working together.

By comparing akka-stream and fs2, I could find out a difference in how many elements are asked to the reactive publisher. That resulted in much more mongo queries when using FS2.

This whole investigation resulted in a new API in FS2. With this change, FS2 is now capable of consuming a reactive stream publisher by asking more than one element at a time. When used with the mongo java driver, it results in less queries fetching each more documents.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK