These are chat archives for 47deg/fetch

6th
Mar 2017
Alejandro Gómez
@dialelo
Mar 06 2017 09:10
hmm really weird @tomjadams, how are you combining the fetches created with Fetch.sequence? it should request everything in a single batch as long as you don't use flatMap to combine two fetches
also make sure the data source doesn't have a maximum batch size configured
Tom Adams
@tomjadams
Mar 06 2017 09:16
Hi @dialelo, unsure what I did for that last comment, but I now have non-batched calls operating concurrently. Batched calls still execute sequentially though. I’ve even re-written a bunch of stuff (that I don’t quite follow) using Concurrent, which doesn’t execute concurrently either.
Alejandro Gómez
@dialelo
Mar 06 2017 09:17
what target monad are you interpreting to? Future?
Tom Adams
@tomjadams
Mar 06 2017 09:17
Yes, the Scala Future.
Alejandro Gómez
@dialelo
Mar 06 2017 09:17
are you using a custom execution context?
Tom Adams
@tomjadams
Mar 06 2017 09:17
But maybe I’ve misinterpreted what is meant to happen. My understanding of maxBatchSize was that it would split the FetchMany into multiple batches, based on that size, then execute each of those concurrently.
So I’d expect say, when fetching 20 items with a batch size of 5, to execute 4 concurrent queries.
But instead I see 4 sequential queries.
Alejandro Gómez
@dialelo
Mar 06 2017 09:19
yes, you are right
it executes them sequentially
when they should be run concurrently
Tom Adams
@tomjadams
Mar 06 2017 09:19
Is that by design? Or just something not implemented yet?
Alejandro Gómez
@dialelo
Mar 06 2017 09:19
great find, I'm opening an issue to address this
is a bug
Tom Adams
@tomjadams
Mar 06 2017 09:20
Cool :thumbsup:
THanks for that!
Alejandro Gómez
@dialelo
Mar 06 2017 09:20
we want all those batches to be requested at the same time
Tom Adams
@tomjadams
Mar 06 2017 09:20
I thought that I was mad!
Alejandro Gómez
@dialelo
Mar 06 2017 09:20
no, thank you for reporting!
Tom Adams
@tomjadams
Mar 06 2017 09:20
Have been pouring over the code for days.
I got as far as writing this before I gave up :smile: https://gist.github.com/tomjadams/bf3b6291822685c960d9c1b7fd0550fd
Alejandro Gómez
@dialelo
Mar 06 2017 09:30
oh, sorry you had to do that
will let you know when i fix the problem with batched queries, i think is safe to say that we can release a fix for that later this week
Tom Adams
@tomjadams
Mar 06 2017 09:36
Sounds good @dialelo, thanks heaps for that.
It was a good learning experience!
I’ve read a lot about using free monads, and seen a few local guys here talk on it, but to actually play with code using it has been quite interesting.
Alejandro Gómez
@dialelo
Mar 06 2017 09:47
is a really interesting architectural approach, both for libraries and applications
we are now working on some tools to ease its use
Tom Adams
@tomjadams
Mar 06 2017 09:48
Oh nice.
Alejandro Gómez
@dialelo
Mar 06 2017 09:48
super experimental, wip here: https://github.com/47deg/freestyle/
Tom Adams
@tomjadams
Mar 06 2017 09:50
Oh nice!
Alejandro Gómez
@dialelo
Mar 06 2017 09:51
we are working on adding some fundamental building blocks: error handling, validation, async computation, fetch/doobie integration ...
before a official release