Coder Social home page Coder Social logo

maarzt / graphics-net-transfers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xulman/graphics-net-transfers

0.0 0.0 0.0 44 KB

...ment for cell tracking data transfers

License: BSD 2-Clause "Simplified" License

Python 76.41% Java 23.59%

graphics-net-transfers's Introduction

What Is Here?

... a communication protocol specification in the Google RPC tooling, and a demo (and thus plain stupid) client and server code in Python and in Java.

It attempts to mirror this with this communication protocol.

How To Build

The building process is here consisting of two stages. In the first stage, the communication protocol .proto file(s) are compiled and language-specific files are generated. The generated files essentially communicate what messages can be passed around and provide some boilerplate code to create client and/or server. The second stage refers to the compilation of demo client and server programs. We provide them in both Python and Java. The second stage is consuming products from the first stage.

In what follows, I assume you're in the root folder of this repo.

Python

Generate Auxiliary GRPC Files

First, make sure the grpcio package is available in your Python installation. How to achieve it is best described at Google, but you can take shortcut:

python -m pip install grpcio
python -m pip install grpcio-tools

The former installs the main executive library, the later is for generating the communication-wrapping code. Both installing steps clearly needs to be done only once.

Second, (re)generate the boilerplate code by calling:

python3 protocol_specification/codegen.py

This should get you the files

peer_in_python/points_and_lines_pb2.py
peer_in_python/points_and_lines_pb2_grpc.py

The former describes the .proto communication protocol, the later contains the boilerplate code.

Compile Demo programs

It's Python, so the title is principally wrong. Just fire:

python3 peer_in_python/demo_server.py
python3 peer_in_python/demo_client.py

Java

Generate Auxiliary GRPC Files

This repo is using the maven to manage the Java project. And the maven generates the necessary files automagically because of these pom.xml lines during the compilation.

Explicit trigger of the generating mechanisms could be achieved, e.g., with:

mvn clean compile

or by executing this target from your IDE.

Ideally, around 38 files should be created. For example these two:

peer_in_java/target/classes/cz/it4i/ulman/transfers/graphics/protocol/PointsAndLinesOuterClass.class
peer_in_java/target/classes/cz/it4i/ulman/transfers/graphics/protocol/PointsAndLinesGrpc.class

The former includes the description of the .proto communication protocol, the later contains the boilerplate code.

Compile Demo programs

Theoretically, just compiling the maven project should work, either with maven:

mvn clean package

or directly from your IDE. Sometimes IDEs, however, have their own heads, so closing the IDE, removing dotIDEfiles and the target folder and setting up the project again from scratch helped me already a couple of times.

graphics-net-transfers's People

Contributors

xulman avatar

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.