def __init__(self, name, priority, actor_context, endpoints,
operation_function, operation_queue):
"""
Create a server
Keyword arguments:
name - Name of the timer
priority - Priority of the subscriber
actor_context - ZMQ context of the actor process
endpoints - A list of endpoint strings
operation_function - Operation function of the subscriber
operation_queue - The operation queue object
"""
self.name = name
self.priority = priority
self.endpoints = endpoints
self.operation_function = operation_function
self.operation_queue = operation_queue
self.context = actor_context
self.server_socket = self.context.socket(zmq.REP)
for endpoint in self.endpoints:
self.server_socket.bind(endpoint)
self.ready = True
self.func_mutex = Lock()
评论列表
文章目录