Fork me on GitHub
#onyx
<
2017-06-08
>
lmergen08:06:52

i wasn’t able to find anything about this in the user guide, but am i allowed to do blocking operations inside an :fn transformation ? i.e. doing HTTP requests and awaiting the results

lmergen08:06:19

i feel that it will have a huge impact on performance if not done async

lmergen08:06:46

so i’m looking for a best practice here

lmergen08:06:28

solutions that i can come up with is splitting this out into two different tasks, and using core.async (= very ugly), or creating a window function (= also very ugly) was hoping there would be native support to return a core.async channel or promise or something from the :fn function

lmergen08:06:49

guess that would have a lot of consequences for flow control tho

mccraigmccraig09:06:37

@lmergen you could mark your :fn as a batch fn http://www.onyxplatform.org/docs/cheat-sheet/latest/#catalog-entry/:onyx/batch-fn-QMARK which would allow you to run a bunch of async tasks concurrently, improving your throughput

lmergen09:06:13

d’oh, of course, you’re completely right this would solve my problem

lmergen09:06:23

much more simple this way