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 flask import Flask, request | |
from nameko.standalone.rpc import ServiceRpcProxy | |
app = Flask(__name__) | |
@app.route('/') | |
def task_list(): | |
return """ | |
<html> |
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
*.pyc |
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
import eventlet | |
eventlet.monkey_patch() | |
def pytest_configure(config): | |
import logging | |
logging.basicConfig(level=logging.DEBUG) # or comment out this line, works fine |
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
machine: | |
python: | |
version: 3.4.3 | |
services: | |
- rabbitmq-server | |
environment: | |
IMAGE_TAG: ${CIRCLE_SHA1} | |
pre: | |
- sudo rabbitmq-plugins enable rabbitmq_management |
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.rpc import rpc | |
class HelloService(object): | |
name = "hello" | |
@rpc | |
def hello(self, name): | |
return "Hello, {}!".format(name) |
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 python:3.4 | |
RUN pip install eventlet | |
COPY test.py /var/tmp/test.py | |
CMD [ "python", "/var/tmp/test.py" ] |
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
import getopt | |
import uuid | |
import sqlite3 | |
import sys | |
from datetime import datetime | |
import os | |
import time | |
import socket |
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
""" 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 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 | |
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 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
import eventlet | |
import eventlet.debug | |
eventlet.debug.hub_exceptions(False) | |
import objgraph | |
import gc | |
import uuid | |
threads = {} |