Quamina alternatives and similar packages
Based on the "Messaging" category.
Alternatively, view quamina alternatives based on common mentions on social networks and blogs.
-
Centrifugo
Scalable real-time messaging server in a language-agnostic way. Set up once and forever. -
machinery
Machinery is an asynchronous task queue/job queue based on distributed message passing. -
NATS Go Client
Golang client for NATS, the cloud native messaging system. -
Confluent Kafka Golang Client
Confluent's Apache Kafka Golang client -
APNs2
⚡ HTTP/2 Apple Push Notification Service (APNs) push provider for Go — Send push notifications to iOS, tvOS, Safari and OSX apps, using the APNs HTTP/2 protocol. -
Uniqush-Push
Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices. -
Chanify
Chanify is a safe and simple notification tools. This repository is command line tools for Chanify. -
mangos
mangos is a pure Golang implementation of nanomsg's "Scalablilty Protocols" -
PingMe
PingMe is a CLI which provides the ability to send messages or alerts to multiple messaging platforms & email. -
amqp
An AMQP 0-9-1 Go client maintained by the RabbitMQ team. Originally by @streadway: `streadway/amqp` -
emitter
Emits events in Go way, with wildcard, predicates, cancellation possibilities and many other good wins -
Bus
🔊Minimalist message bus implementation for internal communication with zero-allocation magic on Emit -
redisqueue
redisqueue provides a producer and consumer of a queue that uses Redis streams -
drone-line
Sending line notifications using a binary, docker or Drone CI. -
go-mq
Declare AMQP entities like queues, producers, and consumers in a declarative way. Can be used to work with RabbitMQ. -
go-events
:mega: Pure nodejs EventEmmiter for the Go Programming Language. -
RapidMQ
RapidMQ is a pure, extremely productive, lightweight and reliable library for managing of the local messages queue -
go-notify
Package notify provides an implementation of the Gnome DBus Notifications Specification. -
Commander
Build event-driven and event streaming applications with ease -
structured pubsub
Publish and subscribe functionality within a single process in Go. -
go-longpoll
Parked: PubSub queuing with long-polling subscribers (not bound to http) -
jazz
Abstraction layer for simple rabbitMQ connection, messaging and administration
Static code analysis for 29 languages.
Do you think we are missing an alternative of Quamina or a related project?
README
Quamina
Fast pattern-matching library
Quamina provides APIs to create an interface called a Matcher, add multiple patterns to it, and then query JSON blobs called events to discover which of the patterns match the fields in the event.
Patterns
Consider the following JSON event, taken from the example in RFC 8259:
{
"Image": {
"Width": 800,
"Height": 600,
"Title": "View from 15th Floor",
"Thumbnail": {
"Url": "http://www.example.com/image/481989943",
"Height": 125,
"Width": 100
},
"Animated" : false,
"IDs": [116, 943, 234, 38793]
}
}
The following patterns would match it:
{"Image": {"Width": [800]}}
{
"Image": {
"Animated": [ false ],
"Thumbnail": {
"Height": [ 125 ]
},
"IDs": [ 943 ]
}
}
{"Image": { "Title": [ { "exists": true } ] } }
{
"Image": {
"Width": [800],
"Title": [ { "exists": true } ],
"Animated": [ false ]
}
}
{"Image": { "Width": [800], "IDs": [ { "exists": true } ] } }
{"Foo": [ { "exists": false } ] }
{
"Image": {
"Thumbnail": { "Url": [ { "shellstyle": "*9943" } ] }
}
}
{
"Image": {
"Thumbnail": { "Url":
[ { "shellstyle": "http://www.example.com/*" } ] }
}
}
{
"Image": {
"Thumbnail": { "Url":
[ { "shellstyle": "http://www.example.com/*9943" } ] }
}
}
The structure of the pattern, in terms of field names and nesting, must be the same as the structure of the event to be matched. The field values are always given as an array; if any element of the array matches the value in the event, the match is good. If the field in the event is array-valued, matching is true if the intersection of the arrays is non-empty.
Fields which are not mentioned in the pattern will be assumed to match, but all Fields mentioned must match. So the semantics are effectively an OR on each field's values, but an AND on the field names.
Note that the shellstyle
patterns can include only
one *
character. The architecture probably allows
support for a larger subset of regular expressions
but currently, the testing for just the single -*
patterns is a bit lacking.
Number matching is weak - the number has to appear exactly the same in the pattern and the event. I.e., Quamina doesn't know that 35, 35.000, and 3.5e1 are the same number.
There's a fix for this in the code which is commented out because it causes a significant performance penalty.
APIs
Note: In all the APIs below, field names and values in both patterns and events must be valid UTF-8. Unescaped characters smaller than 0x1F (illegal per JSON), and bytes with value greater than 0XF4 (can't occur in correctly composed UTF-8) are rejected by the APIs.
func NewMatcher() *Matcher
Creates a new Matcher, takes no arguments.
func (m *Matcher) AddPattern(x X, patternJSON string) error
The first argument identifies the pattern and will be
returned by a Matcher when asked to match against events.
X is currently interface{}
and should become a generic
when Go has them.
The pattern must be provided as a string which is a JSON object as exemplified above in this document.
The error
return is used to signal invalid pattern
structure, which could be bad UTF-8 or malformed JSON
or leaf values which are not provided as arrays.
As many patterns as desired can be added to a Matcher but at this time there is no capability of removing any.
The AddPattern
call is single-threaded; if multiple
threads call it, they will block and execute sequentially.
func (m *Matcher) MatchesForJSONEvent(event []byte) ([]X, error)
The event
argument must be a JSON object encoded in
correct UTF-8. It would be
easy to extend Matcher to handle other data formats; see the
Flattener
interface and its implementation in fj.go
.
The error
return value is nil unless there was an
error in the event JSON.
The []X
return slice may be empty if none of the patterns
match the provided event.
MatchesForJSONEvent
is thread-safe. Many threads may
be executing it concurrently, even while AddPattern
is
also executing.
Performance
The performance of MatchesForJSONEvent
is strongly
sublinear in the number of patterns. It’s not quite O(1)
as it varies somewhat as a function of the number of
unique fields that appear in all the patterns that have
been added to the matcher, but remains sublinear in that
number.
A word of explanation is in order. Quamina compiles the patterns into a somewhat-decorated automaton and uses that to find matches in events; the matching process is O(1) in the number of patterns.
However, for this to work, the incoming event must be flattened into a list of pathname/value pairs and sorted. This process exceeds 50% of execution time, and is optimized by discarding any fields that do not appear in one or more of the patterns added to the matcher. Thus, adding a new pattern that only mentions fields mentioned in previous patterns is effectively free in terms of run-time performance.
Name
From Wikipedia: Quamina Gladstone (1778 – 16 September 1823), most often referred to simply as Quamina, was a Guyanese slave from Africa and father of Jack Gladstone. He and his son were involved in the Demerara rebellion of 1823, one of the largest slave revolts in the British colonies before slavery was abolished.