2
# Copyright 2014 Canonical Ltd.
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU Affero General Public License version 3, as
6
# published by the Free Software Foundation.
8
# This program is distributed in the hope that it will be useful, but
9
# WITHOUT ANY WARRANTY; without even the implied warranties of
10
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
# PURPOSE. See the GNU Affero General Public License for more details.
13
# You should have received a copy of the GNU Affero General Public License
14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
from ci_utils import amqp_utils
22
class PublisherQueue(object):
23
"""A proxy to the queue library.
25
This implementation targets ci_utils/amqp_utils but can be replaced for
29
def __init__(self, queue_name):
30
self.queue_name = queue_name
32
def publish(self, msg):
33
amqp_utils.send(self.queue_name, json.dumps(msg),