[zmq] Add a new ZMQ-based RQL source (closes #2290203)

authorVincent Michel <vincent.michel@logilab.fr>
changeset557295b5b68a
branchdefault
phasepublic
hiddenno
parent revision#a9984ceebc26 [pyro] Refactor the pyrorql source
child revision#e6688dd9fb52 [remote rql source] fix super call
files modified by this revision
server/__init__.py
server/sources/zmqrql.py
# HG changeset patch
# User Vincent Michel <vincent.michel@logilab.fr>
# Date 1333554394 -7200
# Wed Apr 04 17:46:34 2012 +0200
# Node ID 557295b5b68a4e987b7d75b993263d4667fd5436
# Parent a9984ceebc26224433d30aa42757aa26cf05192f
[zmq] Add a new ZMQ-based RQL source (closes #2290203)

diff --git a/server/__init__.py b/server/__init__.py
@@ -294,6 +294,7 @@
1  SOURCE_TYPES = {'native': LazyObject('cubicweb.server.sources.native', 'NativeSQLSource'),
2                  'datafeed': LazyObject('cubicweb.server.sources.datafeed', 'DataFeedSource'),
3                  'ldapfeed': LazyObject('cubicweb.server.sources.ldapfeed', 'LDAPFeedSource'),
4                  'ldapuser': LazyObject('cubicweb.server.sources.ldapuser', 'LDAPUserSource'),
5                  'pyrorql': LazyObject('cubicweb.server.sources.pyrorql', 'PyroRQLSource'),
6 +                'zmqrql': LazyObject('cubicweb.server.sources.zmqrql', 'ZMQRQLSource'),
7                  }
diff --git a/server/sources/zmqrql.py b/server/sources/zmqrql.py
@@ -0,0 +1,27 @@
8 +# copyright 2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
9 +# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
10 +#
11 +# This file is part of CubicWeb.
12 +#
13 +# CubicWeb is free software: you can redistribute it and/or modify it under the
14 +# terms of the GNU Lesser General Public License as published by the Free
15 +# Software Foundation, either version 2.1 of the License, or (at your option)
16 +# any later version.
17 +#
18 +# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
19 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 +# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
21 +# details.
22 +#
23 +# You should have received a copy of the GNU Lesser General Public License along
24 +# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
25 +"""Source to query another RQL repository using pyro"""
26 +
27 +__docformat__ = "restructuredtext en"
28 +_ = unicode
29 +
30 +from cubicweb.server.sources.remoterql import RemoteSource
31 +
32 +class ZMQRQLSource(RemoteSource):
33 +    """External repository source, using ZMQ sockets"""
34 +    CNX_TYPE = 'zmq'