All Projects → Papierkorb → cute

Papierkorb / cute

Licence: MIT License
An event-centric publisher/subscribe model for objects inspired by the Qt framework

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to cute

Goes
Go Event Sourcing made easy
Stars: ✭ 144 (+289.19%)
Mutual labels:  events, event-driven
Joynr
A transport protocol agnostic (MQTT, HTTP, WebSockets etc.) Franca IDL based communication framework supporting multiple communication paradigms (RPC, Pub-Sub, broadcast etc.)
Stars: ✭ 124 (+235.14%)
Mutual labels:  middleware, events
Noel
A universal, human-centric, replayable javascript event emitter.
Stars: ✭ 158 (+327.03%)
Mutual labels:  events, event-driven
Message Io
Event-driven message library for building network applications easy and fast.
Stars: ✭ 321 (+767.57%)
Mutual labels:  events, event-driven
EventEmitter
Simple EventEmitter with multiple listeners
Stars: ✭ 19 (-48.65%)
Mutual labels:  events, event-driven
Eventing
Open source specification and implementation of Knative event binding and delivery
Stars: ✭ 980 (+2548.65%)
Mutual labels:  events, event-driven
Watermill
Building event-driven applications the easy way in Go.
Stars: ✭ 3,504 (+9370.27%)
Mutual labels:  events, event-driven
Remit
RabbitMQ-backed microservices supporting RPC, pubsub, automatic service discovery and scaling with no code changes.
Stars: ✭ 24 (-35.14%)
Mutual labels:  events, event-driven
tardis
Event sourcing toolkit
Stars: ✭ 35 (-5.41%)
Mutual labels:  events, event-driven
evon
Fast and versatile event dispatcher code generator for Golang
Stars: ✭ 15 (-59.46%)
Mutual labels:  events, event-driven
wishbone
A Python framework to build composable event pipeline servers with minimal effort.
Stars: ✭ 42 (+13.51%)
Mutual labels:  events, event-driven
eventcatalog
Discover, Explore and Document your Event Driven Architectures powered by Markdown.
Stars: ✭ 392 (+959.46%)
Mutual labels:  events, event-driven
Event Driven Spring Boot
Example Application to demo various flavours of handling domain events in Spring Boot
Stars: ✭ 194 (+424.32%)
Mutual labels:  events, event-driven
vcenter-connector
Extend vCenter with OpenFaaS
Stars: ✭ 29 (-21.62%)
Mutual labels:  events, event-driven
kstreams-des-demo
Kafka Streams demo project containing Derivative Events, the Processor Api and Wall-clock examples
Stars: ✭ 24 (-35.14%)
Mutual labels:  events, event-driven
burns
Manage your application's events without writing spaghetti code
Stars: ✭ 86 (+132.43%)
Mutual labels:  events, event-driven
use
Easily add plugin support to your node.js application.
Stars: ✭ 25 (-32.43%)
Mutual labels:  middleware
Klendario
A Swift wrapper over the EventKit framework
Stars: ✭ 44 (+18.92%)
Mutual labels:  events
keycloak-session-restrictor
Simple event-listener for Keycloak which restricts the current user sessions to one (last one wins) only. Demo purposes only!
Stars: ✭ 48 (+29.73%)
Mutual labels:  events
library-php
WIP: A comprehensive Domain-Driven Design example with problem space strategic analysis and various tactical patterns.
Stars: ✭ 73 (+97.3%)
Mutual labels:  events

Cute Build Status

An event-centric publisher/subscribe model for objects inspired by the Qt framework and middleware runner.

Why?

Decoupled inter-module communication Using signals, you can let your front- and back-end communicate without letting one know of the other.

Asynchronous work-flow Take action when events occur. Or add this later when a business-case appears. Never poll again.

Resource saving Reduce load on CPU by only rendering only when something happened. Reduce network traffic by batching messages to be sent into fewer densly packed network packets.

Ease development Don't waste too much time on not leaking fibers all over the place.

Standarized communication Use signals at every layer, and have one standarized way of in-process communication. Don't write callback handling code for the umpteenth time. You need to act on data, and not react to it? See middlewares!

Test communication Using Cute.spy, you can spy on signal communication. Have an excuse for not testing it up til now? Well, not anymore :)

Test processing robustness Using middlewares for processing data? You can easily add a middleware which fails: Always for tests, or just now and then. To improve in-process robustness - Or to drive your coworker crazy. Please prefer the former.

Installation

Add this to your application's shard.yml:

dependencies:
  cute:
    github: Papierkorb/cute
    version: ~> 0.4.0

Usage

See samples/ for more examples.

Signals

Let your user know about an event, without disrupting flow, and without writing some callback code for the umpteenth time. This is a notification mechanism, so the callback (the "slot") has no way of returning something to you. If you need that, see the next section.

See the in-source docs of Cute.signal for further details.

require "cute"

class Button
  Cute.signal clicked(x : Int32, y : Int32)
end

btn = Button.new
btn.clicked.on { |x, y| p x, y }
btn.clicked.emit 5, 4 #=> Will print 5, 4

Middleware

It's easy to allow the user of your library to augment, or otherwise extend, the behaviour of your logic. A middleware works akin to a UNIX pipe, where the input arguments (or the result) can be modified along the call.

See the Cute.middleware in-source docs for further details.

class Chat
  @io : IO = STDOUT

  Cute.middleware def send_message(body : String) : Int32
    @io.puts "Sending #{body}"
    body.size
  end
end

chat = Chat.new

# Add a Capt'n Caps middleware :)
chat.send_message.add { |body, yielder| yielder.call(body.upcase) }

# Send a message
chat.send_message.call("Hello") #=> 5
# Prints "Sending HELLO"

Contributing

  1. Fork it ( https://github.com/Papierkorb/cute/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • Papierkorb Stefan Merettig - creator, maintainer
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].