Skip to content
Snippets Groups Projects
Commit ed97fdcf authored by Stefano Borini's avatar Stefano Borini
Browse files

Preparation for release 0.1.0

parent dddde7bf
No related branches found
No related tags found
1 merge request!104Release 0.1.0
FORCE BDSS Changelog
--------------------
Release 0.1.0
-------------
- Initial release. Implements basic functionality of the BDSS and its plugin system.
FORCE BDSS FORCE BDSS
---------- ----------
This repository contains the implementation of the Business Decision System. It is implemented This repository contains the implementation of the Business Decision System.
under the FORCE project (Horizon 2020/NMBP-23-2016/721027). It is implemented under the FORCE project (Horizon 2020/NMBP-23-2016/721027).
import os import os
from setuptools import setup, find_packages from setuptools import setup, find_packages
VERSION = "0.1.0.dev2" VERSION = "0.1.0"
# Read description # Read description
......
import zmq
# Socket to talk to server
context = zmq.Context()
sub_socket = context.socket(zmq.SUB)
sub_socket.bind("tcp://*:12345")
sub_socket.setsockopt(zmq.SUBSCRIBE, "".encode("utf-8"))
sub_socket.setsockopt(zmq.LINGER, 0)
sync_socket = context.socket(zmq.REP)
sync_socket.setsockopt(zmq.LINGER, 0)
sync_socket.bind("tcp://*:12346")
poller = zmq.Poller()
poller.register(sub_socket)
poller.register(sync_socket)
WAITING = 0
RECEIVING = 1
state = WAITING
while True:
events = dict(poller.poll())
if sync_socket in events:
data = sync_socket.recv_string()
print("received ", data)
if data.startswith("HELLO\n"):
sync_socket.send_string(data)
state = RECEIVING
elif data.startswith("GOODBYE\n"):
sync_socket.send_string(data)
state = WAITING
else:
print("unknown request", data)
if sub_socket in events:
if state == RECEIVING:
string = sub_socket.recv_string()
split_data = string.split("\n")
print(split_data)
else:
print("data while waiting. discarding")
string = sub_socket.recv_string()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment