Skip to content

batch processing #21

Description

@tarekziade

We need to be able to perform jobs by batches in a new project - that makes it possible to do bulk inserts in mysql etc.

right now retools uses BPOPL so it's one element each time.

here's one way to do batches:

  • create one list per worker
  • use BRPOPLPUSH and fill the worker-specific list with elements
  • wait until the worker-specific list has the size of the batch, then push its content to the function and purge it
  • use a timer to treat the list when len < batch_size for too long
  • use another list to track all workers lists, so we can ventilate existing elements to a new worker when a worker goes down

What do you think ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions