Replies: 1 comment
-
|
Hello. As far as I remember. The futures in this package are agnostic to how the computations are performed. So basically it's up to the user to whether it is needed to fulfill the future asynchronously or not. For asynchronous fulfillment the user can choose to spawn a new thread, or use Sento.tasks library (preferred) or somehow else. The mapping of futures as ca; be seen in the tests package works in either case. The ˋwith-futˋ macros are just for convenience and for nicer syntax. Regards |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've started playing around with this library, and noticed that whenever I try to make a future using
with-futorwith-fut-resolve, the call toresolve-funin the macroexpanded code blocks on the calculation in the future, which seems to make creating a future meaningless. This is the case even whenfresolveis called in a thread inwith-fut-resolve, sincefresolveexpands to amake-futurecall instead of isolating the call to theresolve-fun.If we just use
sento.future:make-futuredirectly, we can wrap theresolve-funcall in a thread to produce a non-blocking future, as mentioned in the function's docstring. Example:Is there any way to make
with-futandwith-fut-resolvesimilarly non-blocking? And if not, what is the intended use-case for those macros?Beta Was this translation helpful? Give feedback.
All reactions