This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:stretch | |
RUN apt-get update | |
RUN apt-get install -y python3 python3-pip erlang rabbitmq-server unixodbc unixodbc-dev | |
RUN pip3 install pyodbc apscheduler nameko | |
COPY config.yaml /srv/config.yaml | |
COPY service.py /srv/service.py | |
CMD /etc/init.d/rabbitmq-server start; cd /srv; nameko run service --config config.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-----------+ | |
| | | |
| Gateway | | |
| | | |
+-----------+ | |
| | | |
+-------+ +-------+ | |
| | | |
+-----v-----+ +-----v-----+ | |
| | | | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kombu import Connection | |
import time | |
import threading | |
import socket | |
AMQP_URI = "pyamqp://guest:guest@localhost:5672/" | |
DEFAULT_TIMEOUT = 1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.yield_fixture | |
def pdb_worker_exceptions(): | |
import pdb | |
from mock import patch | |
from nameko.containers import ServiceContainer | |
unpatched = ServiceContainer._worker_result | |
def attach_pdb(self, worker_ctx, result, exc_info): | |
if exc_info: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*_pb2.py | |
*_pb2_grpc.py | |
__pycache__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from setuptools import setup, find_packages | |
setup( | |
name='MyPackageName', | |
version='1.0.0', | |
url='https://github.com/mypackage.git', | |
author='Author Name', | |
author_email='[email protected]', | |
description='Description of my package', | |
packages=[], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nameko.standalone.rpc import ClusterRpcProxy | |
from time import perf_counter, sleep | |
import pkg_resources | |
config = { | |
"AMQP_URI": "amqp://guest:guest@localhost:5672" # e.g. "pyamqp://guest:guest@localhost" | |
} | |
with ClusterRpcProxy(config) as cluster_rpc: |
OlderNewer