metal-pony / bucket

haz bucket
0 stars 0 forks source link

EventBus Multithreaded event handling #58

Open metal-pony opened 1 year ago

metal-pony commented 1 year ago

From https://github.com/sparklicorn/bucket/issues/15

Multithreaded event handling

Currently, event handlers are executed serially in the order that they are polled from the work queue. It could be useful to be able to process events concurrently, e.g. think of how a web server handles many requests at a time.

Objectives

1) Convert code to allow use of multiple worker threads. 2) Add constructor option to specify the number of worker threads.

metal-pony commented 1 year ago

Clarification: While the description states "handlers are executed serially as polled from the work queue", this occurs in a separate thread.

Objective updates:

  1. Support having no worker threads, i.e. events are processed in the calling thread.