Beispiel #1
0
'''
from multiprocessing import Queue
import asyncio
import logging
import json
import os

from cryptostore.spawn import Spawn
from cryptostore.config import DynamicConfig
from cryptostore.log import get_logger
from cryptostore.aggregator.aggregator import Aggregator
from cryptostore.plugin.controller import PluginController

LOG = get_logger('cryptostore',
                 'cryptostore.log',
                 logging.INFO,
                 size=50000000,
                 num_files=10)


class Cryptostore:
    def __init__(self, config=None):
        self.queue = Queue()
        self.spawner = Spawn(self.queue)
        self.running_config = {}
        self.cfg_path = config
        self.plugin = PluginController(config)
        self.plugin.start()

    async def _load_config(self, start, stop):
        LOG.info("start: %s stop: %s", str(start), str(stop))
Please see the LICENSE file for the terms and conditions
associated with this software.
'''
from multiprocessing import Queue
import asyncio
import logging
import json

from cryptostore.spawn import Spawn
from cryptostore.config import Config
from cryptostore.log import get_logger
from cryptostore.aggregator.aggregator import Aggregator


LOG = get_logger('cryptostore', 'cryptostore.log', logging.INFO)


class Cryptostore:
    def __init__(self, config=None):
        self.queue = Queue()
        self.spawner = Spawn(self.queue)
        self.running_config = {}
        self.cfg_path = config

    async def _load_config(self, start, stop):
        LOG.info("start: %s stop: %s", str(start), str(stop))
        for exchange in stop:
            self.queue.put(json.dumps({'op': 'stop', 'exchange': exchange}))

        for exchange in start: