Example #1
0
 def connect(self):
     if self.connectingDeferred is None:
         self.connectingDeferred = YamClient.connect(self)
     return self.connectingDeferred  # XXX: What happens when the factory
Example #2
0
DBPOOL = common.get_database("afos")
MEMCACHE_EXCLUDE = [
    "RR1",
    "RR2",
    "RR3",
    "RR4",
    "RR5",
    "RR6",
    "RR7",
    "RR8",
    "RR9",
    "ROB",
    "HML",
]
MEMCACHE_CLIENT = YamClient(reactor, ["tcp:iem-memcached3:11211"])
MEMCACHE_CLIENT.connect()


def shutdown():
    """ Down we go! """
    log.msg("Stopping...")
    reactor.callWhenRunning(reactor.stop)  # @UndefinedVariable


# LDM Ingestor
class MyProductIngestor(ldmbridge.LDMProductReceiver):
    """ I receive products from ldmbridge and process them 1 by 1 :) """
    def connectionLost(self, reason):
        """ called when the connection is lost """
        log.msg("connectionLost")
        log.err(reason)
Example #3
0
import datetime

import pytz
from twisted.python import log
from twisted.internet import reactor
from txyam.client import YamClient
from pyldm import ldmbridge
from pyiem.nws import product
from pyiem.util import utc
import common  # @UnresolvedImport

DBPOOL = common.get_database('afos')
MEMCACHE_EXCLUDE = ['RR1', 'RR2', 'RR3', 'RR4', 'RR5', 'RR6', 'RR7', 'RR8',
                    'RR9', 'ROB', 'HML']
MEMCACHE_CLIENT = YamClient(reactor, ['tcp:iem-memcached3:11211', ])
MEMCACHE_CLIENT.connect()


def shutdown():
    """ Down we go! """
    log.msg("Stopping...")
    reactor.callWhenRunning(reactor.stop)  # @UndefinedVariable


# LDM Ingestor
class MyProductIngestor(ldmbridge.LDMProductReceiver):
    """ I receive products from ldmbridge and process them 1 by 1 :) """

    def connectionLost(self, reason):
        """ called when the connection is lost """
        log.msg('connectionLost')