OO Refactor event_handler_connector.py temporary solution

This commit is contained in:
Kristóf Tóth
2018-01-29 15:28:51 +01:00
parent 16dad5e2cd
commit 6e6d775a05
4 changed files with 47 additions and 27 deletions

View File

@ -1,4 +1,4 @@
import json, xmlrpc.client
import json, xmlrpc.client, zmq
from config.envvars import SUPERVISOR_HTTP_URI
@ -15,5 +15,11 @@ def create_source_code_response_data(filename, content, language):
'language': language
}
class SupervisorMixin:
supervisor = xmlrpc.client.ServerProxy(SUPERVISOR_HTTP_URI).supervisor
supervisor = xmlrpc.client.ServerProxy(SUPERVISOR_HTTP_URI).supervisor
class ZMQConnectorBase:
def __init__(self, zmq_context=None):
self._zmq_context = zmq_context or zmq.Context.instance()