Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
python-handel
Commits
504f334c
Commit
504f334c
authored
Oct 23, 2017
by
Vincent Michel
Browse files
Fix gevent patch
parent
d040c8d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
handel/gevent.py
View file @
504f334c
...
...
@@ -10,7 +10,7 @@ from __future__ import absolute_import
from
functools
import
wraps
from
gevent
import
threadpool
from
.interface
import
handel
from
.
import
interface
# Green pool
...
...
@@ -41,7 +41,12 @@ def patch():
>>> from handel.gevent import patch
>>> patch()
"""
for
name
in
dir
(
handel
):
# Gevent-compatible version of handel FFI library
gevent_handel
=
type
(
'GeventFFILibrary'
,
(),
{})()
# Populate gevent_handel
for
name
in
dir
(
interface
.
handel
):
if
name
.
startswith
(
'xia'
):
func
=
getattr
(
handel
,
name
)
setattr
(
handel
,
name
,
green
(
func
))
func
=
getattr
(
interface
.
handel
,
name
)
setattr
(
gevent_handel
,
name
,
green
(
func
))
# Patch
interface
.
handel
=
gevent_handel
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment