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
*.pyc |
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 | |
eventlet.monkey_patch() | |
from eventlet.greenpool import GreenPile | |
from kombu.pools import producers | |
from kombu import Exchange, Queue | |
exchange = Exchange('exchange', type='direct') | |
queue = Queue('queue', exchange, routing_key='queue') |
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
from flask import Flask, request | |
from nameko.standalone.rpc import ServiceRpcProxy | |
app = Flask(__name__) | |
@app.route('/') | |
def task_list(): | |
return """ | |
<html> |
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
""" 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 |
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
[run] | |
branch = True | |
source = . |
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='author@gmail.com', | |
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: |
NewerOlder