Accumulate task inputs
See original GitHub issueUse Case
Please provide a use case to help us understand your request in context
It would be great to be able to accumulate multiple task calls and execute them all at once. Examples are neural networks and database queries: doing one request at a time we don’t use resources efficiently and get ourselves a bottleneck.
Solution
Please describe your ideal solution
The simplest solution is to implement something like this.
We need to add flush_every
and flush_interval
parameters to the Task
class.
Alternatives
Please describe any alternatives you’ve considered, even if you’ve dismissed them
I’ve read about Task Loops, but they don’t quite work because they just run the task with the same arguments multiple times, whereas we need to run job once, but with multiple arguments.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Solved You need to complete the following four tasks. Task
Task 1: Accumulate Inputs (6 marks) Create a program that conducts the following processes: 1) Accumulates the user's inputs. (Let users enter the...
Read more >An Accumulation-of-Evidence Task Using Visual Pulses for ...
Here, we describe a new evidence-accumulation task for head-fixed mice navigating in a virtual reality (VR) environment.
Read more >DAT2219d : Repetitions To Accumulate Counts and Totals
Consider how these 3 stages apply to a typical task of accumulating a total: ... from somewhere (possibly, but not necessarilly, from a...
Read more >Behavioral task and temporal accumulation of sensory input for...
Download scientific diagram | Behavioral task and temporal accumulation of sensory input for decision-making a Schematic of task events during example trial ...
Read more >Flow Accumulation—ArcGIS REST APIs
The type of input flow direction raster between these three influences how the FlowAccumulation task partitions and accumulates flow in each cell.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Since prefect stores state (and if using cloud/server also posts state to a server) for every task, there is always going to be overhead per task. If you’re running fast tasks in prefect, you might consider wrapping these into a bulk api and having prefect schedule them at a higher level:
We could implement batching in prefect, but that gets complicated to schedule when dealing with retries, etc… IMO I’d like to see more use cases that require changes (and can’t be done with user-level batching) before going down this route.
For mapped tasks there’s the suggestion in #2459 that I think we would be willing to support, would this be sufficient for your needs?
This issue was closed because it has been stale for 14 days with no activity. If this issue is important or you have more to add feel free to re-open it.