Skip to content

cardo-org/Rembus.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rembus

Stable Dev Build Status Coverage Code Style: Blue

Rembus is a middleware to implement high performance and fault-tolerant distributed applications.

Key Features

  • Built-in support for exchanging DataFrames.

  • Macro-based API that make writing RPC and Pub/Sub applications simple and fast.

  • Multiple transport protocols: Tcp, Web Socket, ZeroMQ.

  • Binary message encoding using CBOR.

The broker

Start the broker:

julia -e "using Rembus; caronte()"

RPC server

@component "myserver"

function myservice(arg1)
    return "hello $arg1 💗"
end

@expose myservice

# Serve forever until Ctrl-C 
# in REPL forever() is not needed
forever()

The @component macro declares a unique name for the component that get known to the broker. On the broker side such identity permits to bind a twin operating on the behalf of the component either when it is offline.

RPC client

response = @rpc myservice("rembus")

When a name is not declared with @component then a random uuid identifier is associated with the component each time the application starts.

Pub/Sub subscriber

@component "myconsumer"

function mytopic(df::DataFrame)
    println("mean_a=$(mean(df.a)), mean_b=$(mean(df.b))")
end

@subscribe mytopic

# forever() serves forever until Ctrl-C 
# in REPL forever() is not needed
forever()

Pub/Sub publisher

df = DataFrame(a=1:1_000_000, b=rand(1_000_000))

@publish mytopic(df)

About

A middleware for RPC and Pub/Sub communication styles

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages