diff -r 000000000000 -r 11f0f97d508f src/pyams_zmq/interfaces/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_zmq/interfaces/__init__.py Wed Mar 04 22:40:07 2015 +0100 @@ -0,0 +1,47 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + +# import standard library + +# import interfaces +from zope.interface import Interface, Attribute + +# import packages + + +class IZMQProcess(Interface): + """ZeroMQ process interface""" + + socket_type = Attribute("Socket type") + + def setup(self): + """Initialize process context and events loop and initialize stream""" + + def stream(self, sock_type, addr, bind, callback=None, subscribe=b''): + """Create ZMQStream""" + + def init_stream(self): + """initialize response stream""" + + def start(self): + """Start the process""" + + def stop(self): + """Stop the process""" + + +class IZMQMessageHandler(Interface): + """ZeroMQ message handler""" + + handler = Attribute("Concrete message handler")