Commit f7a7c6a7 authored by Jim Fulton's avatar Jim Fulton Committed by GitHub

Merge pull request #70 from zopefoundation/uvloop

Uvloop
parents 772221b8 417b4b61
......@@ -18,14 +18,14 @@ matrix:
python: 2.7
env: ZEO4_SERVER=1
- os: linux
python: 3.4
python: 3.5
env: ZEO4_SERVER=1
- os: linux
python: 3.5
env: ZEO4_SERVER=1
env: BUILOUT_OPTIONS=extra=,uvloop
install:
- pip install zc.buildout
- buildout
- buildout $BUILOUT_OPTIONS
cache:
directories:
- eggs
......
......@@ -4,6 +4,7 @@ parts =
test
scripts
versions = versions
extra =
[versions]
......@@ -11,7 +12,7 @@ versions = versions
[test]
recipe = zc.recipe.testrunner
eggs =
ZEO [test]
ZEO [test${buildout:extra}]
initialization =
import os, tempfile
try: os.mkdir('tmp')
......@@ -21,6 +22,5 @@ defaults = ['--all']
[scripts]
recipe = zc.recipe.egg
eggs =
ZEO [test]
eggs = ${test:eggs}
interpreter = py
......@@ -128,7 +128,7 @@ setup(name="ZEO",
classifiers = classifiers,
test_suite="__main__.alltests", # to support "setup.py test"
tests_require = tests_require,
extras_require = dict(test=tests_require),
extras_require = dict(test=tests_require, uvloop=['uvloop']),
install_requires = install_requires,
zip_safe = False,
entry_points = """
......
......@@ -2,8 +2,13 @@ from .._compat import PY3
if PY3:
import asyncio
try:
from uvloop import new_event_loop
except ImportError:
from asyncio import new_event_loop
else:
import trollius as asyncio
from trollius import new_event_loop
from ZEO.Exceptions import ClientDisconnected, ServerException
import concurrent.futures
......@@ -836,7 +841,7 @@ class ClientThread(ClientRunner):
def run(self):
loop = None
try:
loop = asyncio.new_event_loop()
loop = new_event_loop()
self.setup_delegation(loop)
self.started.set()
loop.run_forever()
......
......@@ -120,6 +120,7 @@ class SSLConfigTest(ZEOConfigTestBase):
@mock.patch(('asyncio' if PY3 else 'trollius') + '.async')
@mock.patch(('asyncio' if PY3 else 'trollius') + '.set_event_loop')
@mock.patch(('asyncio' if PY3 else 'trollius') + '.new_event_loop')
@mock.patch('ZEO.asyncio.client.new_event_loop')
class SSLConfigTestMockiavellian(ZEOConfigTestBase):
@mock.patch('ssl.create_default_context')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment