How to use the aiomas.Container function in aiomas

To help you get started, we’ve selected a few aiomas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github frnsys / system_designer / syd / node / node.py View on Github external
import aiomas
import asyncio
import logging
import operator
import itertools
from .proxy import LocalProxy

logger = logging.getLogger(__name__)


class Node(aiomas.Container):
    """a node manages a population of agents"""
    def __init__(self, addr, *args, **kwargs):
        super().__init__(addr, *args, **kwargs)
        self._local_agent_proxies = {}

        # prepare logging for each node
        _, port = addr[:-1].rsplit(':', 1)
        handler = logging.FileHandler('/tmp/sydspawn_{}.log'.format(port))
        handler.setLevel(logging.DEBUG)
        self.logger = logging.getLogger(__name__)
        self.logger.addHandler(handler)
        self.logger.debug('node up at {}'.format(addr))


    @classmethod
    async def start(cls, addr, **container_kwargs):

aiomas

Asyncio-based, layered networking library providing request-reply channels, RPC, and multi-agent systems.

MIT
Latest version published 7 years ago

Package Health Score

39 / 100
Full package analysis