Added ZMS process started event
authorThierry Florac <thierry.florac@onf.fr>
Thu, 10 Jan 2019 16:59:31 +0100
changeset 21 6bcc3d05459e
parent 20 3fc37f238cff
child 22 05aaf0acf4fb
Added ZMS process started event
src/pyams_zmq/interfaces.py
src/pyams_zmq/interfaces/__init__.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_zmq/interfaces.py	Thu Jan 10 16:59:31 2019 +0100
@@ -0,0 +1,52 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# 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'
+
+from zope.interface import Attribute, Interface, implementer
+from zope.interface.interfaces import IObjectEvent, ObjectEvent
+
+
+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 IZMQProcessStartedEvent(IObjectEvent):
+    """ZMQ process started event interface"""
+
+
+@implementer(IZMQProcessStartedEvent)
+class ZMQProcessStartedEvent(ObjectEvent):
+    """ZMQ process started event"""
+
+
+class IZMQMessageHandler(Interface):
+    """ZeroMQ message handler"""
+
+    handler = Attribute("Concrete message handler")
--- a/src/pyams_zmq/interfaces/__init__.py	Fri Oct 26 09:59:34 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#
-# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
-# 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")