Giter Site home page Giter Site logo

protoqueue's Introduction

ProtoQueue Build Status Coverage Status

ProtoQueue is a template wrapper around zeromq that simplifies sending and receiving protobuf messages. It abstracts away the messiness of context and port management, allowing you to maintain focus on the semantics of your network topology and message protocol.

Look at how easy it is to pass this message around:

// basic.proto
message Basic {
  required string value = 1;
}
#include <protoqueue.h> // This is the API header
#include <iostream>
#include "basic.pb.h"

int main(int argc, char** argv) {
    // This chooses a port for you and binds a ZMQ_PAIR to it by default
    auto sender = prism::protoqueue::Bind<Basic>();

    // This connects to the same port with a ZMQ_PAIR socket
    auto receiver = prism::protoqueue::Connect<Basic>(sender.get_port()); 

    Basic basic;
    basic.set_value("hello world!");
    sender.Send(basic);

    auto received = receiver.Receive();
    std::cout << received.value() << std::endl; // Prints "hello world!"
}

Without ProtoQueue, you're stuck with this mess.

Requirements

Build

The recommended way to build this library is by using an out of source build directory:

mkdir build
cd build
cmake ..
make

By default, this will build the tests. To run the tests, simply run:

ctest

This project has an embedded source of the googletest framework so it is not explicitly required on your system. To use your system version, set this CMake option:

cmake -DUSE_SYSTEM_GTEST=ON ..

and then run make.

A successful build will result in a single library that you can link against your project.

Contributing

Please fork this repository and contribute back using pull requests. Features can be requested using issues.

protoqueue's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.