All Projects → paddor → cztop

paddor / cztop

Licence: ISC license
CZMQ binding for Ruby

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to cztop

cargo-valgrind
A cargo subcommand, that runs valgrind and displays its output in a helpful manner.
Stars: ✭ 66 (+120%)
Mutual labels:  ffi-bindings
raml
OCaml runtime and FFI bindings directly in Rust
Stars: ✭ 75 (+150%)
Mutual labels:  ffi-bindings
fsevent-rust
FSEvent bindings for rust.
Stars: ✭ 38 (+26.67%)
Mutual labels:  ffi-bindings
foundationdb-haskell
Haskell FFI bindings to the FoundationDB C API
Stars: ✭ 32 (+6.67%)
Mutual labels:  ffi-bindings
coqffi
Coq to OCaml FFI made easy [maintainer=@lthms]
Stars: ✭ 27 (-10%)
Mutual labels:  ffi-bindings
rust-ffi-examples
FFI examples written in Rust
Stars: ✭ 42 (+40%)
Mutual labels:  ffi-bindings
cuda
Haskell FFI bindings to CUDA
Stars: ✭ 73 (+143.33%)
Mutual labels:  ffi-bindings
ffi-libc
Useful Ruby FFI bindings for libc
Stars: ✭ 32 (+6.67%)
Mutual labels:  ffi-bindings
OCaml-GObject-Introspection
OCaml bindings to GObject-Introspection based on OCaml-Ctypes.
Stars: ✭ 15 (-50%)
Mutual labels:  ffi-bindings
eta-ffi
A command line tool to automate the generation of ffi import code for the bindings of various Java libraries.
Stars: ✭ 19 (-36.67%)
Mutual labels:  ffi-bindings
odbc-rs
Rust ODBC FFI binding
Stars: ✭ 90 (+200%)
Mutual labels:  ffi-bindings

Specs status Specs status codecov

CZTop

CZTop is a CZMQ binding for Ruby. It is based on czmq-ffi-gen, the generated low-level FFI binding of CZMQ and has a focus on being easy to use for Rubyists (POLS) and providing first class support for security mechanisms (like CURVE).

Overview

Class Hierarchy

Here's an overview of the core classes:

More information in the API documentation.

Features

  • Ruby-like API
    • method names
      • sending a message via a socket is done with Socket#<<
        • socket << "simple message"
        • socket << ["multi", "frame", "message"]
      • #x= methods instead of #set_x (e.g. socket options)
      • #[] where it makes sense (e.g. on a Message, Config, or Certificate)
    • no manual error checking needed
      • if there's an error, an appropriate exception is raised
    • of course, no manual dealing with the ZMQ context
  • easy security
    • use Socket#CURVE_server!(cert) on the server
    • and Socket#CURVE_client!(client_cert, server_cert) on the client
  • socket types as Ruby classes
    • no need to manually pass type constants
      • but you can: CZTop::Socket.new_by_type(:REP)
    • e.g. #subscribe only exists on CZTop::Socket::SUB

Requirements

  • CZMQ >= 4.2
  • ZMQ >= 4.3

On Ubuntu 20.04+:

$ sudo apt install libczmq-dev

On macOS using Homebrew, run:

$ brew install czmq

Supported Rubies

  • MRI (2.6, 2.7, 3.0)
  • Rubinius (HEAD)
  • JRuby 9000 (HEAD)

Installation

To use this gem, add this line to your application's Gemfile:

gem 'cztop'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cztop

Documentation

The API should be fairly straight-forward to anyone who is familiar with CZMQ and Ruby. The following API documentation is currently available:

Feel free to start a wiki page.

Performance

CZTop is just a convenience layer on top of the thin czmq-ffi-gen library.

Make sure to check out the perf directory for latency and throughput measurement scripts.

Usage

See the examples directory for some examples.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/paddor/cztop.

To run the tests before/after you made any changes to the source and have created a test case for it, use rake spec.

License

The gem is available as open source under the terms of the ISC License. See the LICENSE file.

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].