You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey - thanks for this excellent package! My code is littered with @memoize!
I have a feature request/idea:
I have a lot of IO-operations and have thus made my code highly concurrent (littered with @async...).
So to @memoize IO operations while making sure I only load stuff once, I frequently use the following pattern:
Hence, by memoizing the Task created by @async, we make sure stuff is only loaded once even when multiple concurrent tasks might like to load the same thing at the same time.
It would be nice if the above could be wrapped in a macro (e.g. @task_memoize ?). As a performance enhancement, the @task_memoize macro could potentially unwrap the result from its task once the task is done. Then the task can be GC'ed and only the result needs to be saved.
Thoughts/suggestions welcome - can't help thinking the above use-case is relatively generic/common.
I might take a stab at it myself - although I have doubts my macro-manipulating skills are currently fit for the job.
The text was updated successfully, but these errors were encountered:
Hey - thanks for this excellent package! My code is littered with
@memoize
!I have a feature request/idea:
I have a lot of IO-operations and have thus made my code highly concurrent (littered with
@async...
).So to
@memoize
IO operations while making sure I only load stuff once, I frequently use the following pattern:Hence, by memoizing the
Task
created by@async
, we make sure stuff is only loaded once even when multiple concurrent tasks might like to load the same thing at the same time.It would be nice if the above could be wrapped in a macro (e.g.
@task_memoize
?). As a performance enhancement, the@task_memoize
macro could potentially unwrap the result from its task once the task is done. Then the task can be GC'ed and only the result needs to be saved.Thoughts/suggestions welcome - can't help thinking the above use-case is relatively generic/common.
I might take a stab at it myself - although I have doubts my macro-manipulating skills are currently fit for the job.
The text was updated successfully, but these errors were encountered: