Skip to content

User OrderedDict to retain FIFO order of task processing #10

@Lyalpha

Description

@Lyalpha

The switch to a set to handle the tasks in TaskQueue means we don't get duplicate tasks, at the expense of my_set.pop() returning arbitrary entries.

OrderedDict has the best of both worlds:

  • keys remain unique, so we can _put a task using my_dict['task_info'] = None and it will replace the same entry, and retain the same index position in the dict.
  • there is the my_dict.popitem(last=False) to _get a task in a FIFO sense.

Easy to add.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions