This file contains 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: |
This file contains 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 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 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 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 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 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 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
import eventlet | |
import eventlet.debug | |
eventlet.debug.hub_exceptions(False) | |
import objgraph | |
import gc | |
import uuid | |
threads = {} |
This file contains 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 | |
config = { | |
'AMQP_URI': 'amqp://guest:guest@localhost:5672/' | |
} | |
with ClusterRpcProxy(config) as rpc: | |
session_token = rpc.auth.login("admin", "secret") | |
with ClusterRpcProxy(config, context_data={'session': session_token}) as rpc: |
This file contains 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
""" Regression tests for https://github.com/nameko/nameko/issues/428 | |
The tests in this module show detailed examples of possible failures caused | |
by the above bug. It's being left here rather than in the repo since the tests | |
themselves are quite slow, and one is sufficient to verify the regression. | |
""" | |
import itertools | |
import time | |
from functools import partial |
NewerOlder