# Path: e3d/_baseManager.py
# class BaseManager(object):
#     def __init__(self):
#         self._engine = None
# 
#     def initialize(self, engine):
#         self._engine = engine
# 
#     def terminate(self):
#         pass
# 
# Path: e3d/Logging.py
# class logLevelsEnum(object):
#     debug = 0
#     info = 1
#     warning = 2
#     error = 3


from sys import platform
    from multiprocessing.dummy import Process, Queue
    from multiprocessing import Process, Queue
    from queue import Full, Empty
    from Queue import Full, Empty
from .._baseManager import BaseManager
from ..Logging import logLevelsEnum
class Communicator(object):
    def __init__(self):
        self._inQueue = Queue()
        self._outQueue = Queue()

    def _readTask(self):
        try:
            task = self._inQueue.get_nowait()
        except Empty:
            return

        if not isinstance(task, Task):
            self._engine.log('server sent data with wrong type. Ignored.', logLevelsEnum.warning)
        else:
            return task

    def _sendTask(self, task, wait=False):
        if not isinstance(task, Task):
            raise TypeError('task must be of type \'Task\'')
        try:
            if wait:
                self._outQueue.put(task, timeout=1)
            else:
                self._outQueue.put_nowait(task)
        except Full:
            self._engine.log('out queue is full. Missed data!', logLevelsEnum.warning)


class ParallelClient(BaseManager, Communicator):
    def __init__(self):

# Path: e3d/_baseManager.py
# class BaseManager(object):
#     def __init__(self):
#         self._engine = None
# 
#     def initialize(self, engine):
#         self._engine = engine
# 
#     def terminate(self):
#         pass
# 
# Path: e3d/Logging.py
# class logLevelsEnum(object):
#     debug = 0
#     info = 1
#     warning = 2
#     error = 3


# Path: e3d/ParallelCommunicators/Services.py
from sys import platform
    from multiprocessing.dummy import Process, Queue
    from multiprocessing import Process, Queue
    from queue import Full, Empty
    from Queue import Full, Empty
from .._baseManager import BaseManager
from ..Logging import logLevelsEnum

class Communicator(object):
    def __init__(self):
        self._inQueue = Queue()
        self._outQueue = Queue()

    def _readTask(self):
        try:
            task = self._inQueue.get_nowait()
        except Empty:
            return

        if not isinstance(task, Task):
            self._engine.log('server sent data with wrong type. Ignored.', logLevelsEnum.warning)
        else:
            return task

    def _sendTask(self, task, wait=False):
        if not isinstance(task, Task):
            raise TypeError('task must be of type \'Task\'')
        try:
            if wait:
                self._outQueue.put(task, timeout=1)
            else:
                self._outQueue.put_nowait(task)
        except Full:
            self._engine.log('out queue is full. Missed data!', logLevelsEnum.warning)


class ParallelClient(BaseManager, Communicator):
    def __init__(self):

        BaseManager.__init__(self)