Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timbray/quamina
Home of Quamina, a fast pattern-matching library in Go
https://github.com/timbray/quamina
event-driven events go golang json
Last synced: 4 days ago
JSON representation
Home of Quamina, a fast pattern-matching library in Go
- Host: GitHub
- URL: https://github.com/timbray/quamina
- Owner: timbray
- License: apache-2.0
- Created: 2022-01-25T03:23:41.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-29T23:45:28.000Z (12 days ago)
- Last Synced: 2024-12-03T04:44:19.668Z (9 days ago)
- Topics: event-driven, events, go, golang, json
- Language: Go
- Homepage:
- Size: 42.1 MB
- Stars: 395
- Watchers: 18
- Forks: 20
- Open Issues: 16
-
Metadata Files:
- Readme: README-pruner.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - Quamina - Fast pattern-matching for filtering messages and events. (Messaging / Search and Analytic Databases)
- zero-alloc-awesome-go - Quamina - Fast pattern-matching for filtering messages and events. (Messaging / Search and Analytic Databases)
- awesome-eventbridge - Quamina - Go pattern match library following EventBridge pattern style. Use this package in your applications to only send events to EventBridge if they match the registered patterns. Improves latency and reduces cost in applications. (Tools)
- awesome-go-extra - quamina - matching library in Go|239|10|12|2022-01-25T03:23:41Z|2022-08-24T01:43:26Z| (Messaging / Advanced Console UIs)
README
# `DeletePattern`
The core quamina.Matcher doesn't currently support deleting patterns.
Some of the contemplated implementations would probably be pretty
difficult. At least one approach is pretty easy: Wrap the current
matcher to filter removed patterns from match results and periodically
rebuild the matcher from scrach with the live patterns. More
specifically:1. Remember patterns that have been added
2. Remember patterns that have been removed (implicitly)
3. Filter `MatchesFor...()` results to remove any removed patterns
4. Rebuilding the matcher state periodically with only the live
patterns
5. Maintain some statistics to help decide when to rebuildThe implementation of the set of live patterns is pluggable via a Go
interface (`State`). The default implementation `MemState` is just a
`map[quamina.X]string`. Other implementations could provide
persistence.By default, rebuilding is triggered automatically (synchronously
currently) during mutations. You can also force a manual `Rebuild()`,
and you can `DisableRebuild()` to prevent any automation rebuilds.
The code also supports pluggable rebuilding policies, but those
features are not currently exposed.