Skip to content

dsolmann/core_storm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Core Storm

Running & Building

To build:

~> cargo build --release

To run (in debug):

~> cargo run

Description

Core Storm is a protocol aggregation system. You give it a message & address - it will handle delivery for you to make sure that your message was received.

Idea

Under the hood Core Storm has several message queues to maximize efficiency on multicore systems.

Receiving

Since message got received by some of Transports, Transport will immediately put this message in first queue. Then, this Message will be taken by optional Middleware, which can be used to filter packages or do something else. After that, Middleware will put (or not) message into the next queue, where Dispatcher will take it & make sure that it'll be retranslated or sent to some internal listener.

Usage

Example receiving program:

use core_storm::stormer::CoreStorm;
use core_storm::protocol::Addr;
use core_storm::protocol::UpperProto;
use core_storm::transports::sample_transport;

fn main() {
    let addr = Addr::random(); // Setting up our CS address.
    let mut storm = CoreStorm::new(addr, 3, 1024); // Creating instance of our daemon.
    storm.register_handler(UpperProto::MetaProto, |msg| {
        println!("{:#?}", msg.id)
    }); // Registering handler (in this case, it'll just print messages, which match `MetaProto` protocol)
    storm.start(); // Note: it'll start in different threads.
    sample_transport(&storm.input_queue, addr); // Registering some transport
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages