Implement dispatcher type for efficient filtering
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 135
- Forks
- 27
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 8
Description
Broadcaster distributing to a set of filtered sinks is fairly efficient in practice but still requires O(N) for every message sent. Provide the following interface definition to allow implementation of efficient event dispatch:
func NewDispatcher(selector Selector) *Dispatcher
type Selector interface {
// Select zero or more sinks on which the event should be sent.
Select(event Event) []Sink
}
This will allow events to be dispatched to a large set of listeners without incurring O(N) overhead for all messages.
This can also be used to implement load balancing of messages to support worker queues.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing Broadcaster behavior and the proposed NewDispatcher, Dispatcher, Selector, Event, and Sink interfaces in the issue. Determine how selector-based dispatch should integrate with filtered sinks and worker-queue load balancing. Done means the dispatcher supports selecting zero or more sinks without requiring every message to scan the full listener set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100