Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
337111f3
Commit
337111f3
authored
Jul 30, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proc: deprecate spawn_greenlet, use gevent.spawn which is the same
parent
a6cbb496
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
gevent/proc.py
gevent/proc.py
+4
-2
No files found.
gevent/proc.py
View file @
337111f3
...
...
@@ -226,6 +226,8 @@ def spawn_greenlet(function, *args):
The current greenlet won't be unscheduled. Keyword arguments aren't
supported (limitation of greenlet), use spawn() to work around that.
"""
import
warnings
warnings
.
warn
(
"gevent.proc.spawn_greenlet is deprecated; use gevent.spawn"
,
DeprecationWarning
,
stacklevel
=
2
)
g
=
greenlet
.
Greenlet
(
function
)
g
.
parent
=
greenlet
.
get_hub
().
greenlet
core
.
active_event
(
g
.
switch
,
*
args
)
...
...
@@ -563,7 +565,7 @@ class Proc(Source):
assert
self
.
greenlet
is
None
,
"'run' can only be called once per instance"
if
self
.
name
is
None
:
self
.
name
=
str
(
function
)
self
.
greenlet
=
spawn_greenlet
(
self
.
_run
,
function
,
args
,
kwargs
)
self
.
greenlet
=
greenlet
.
spawn
(
self
.
_run
,
function
,
args
,
kwargs
)
def
_run
(
self
,
function
,
args
,
kwargs
):
"""Internal top level function.
...
...
@@ -806,7 +808,7 @@ class Pool(object):
def
execute_async
(
self
,
func
,
*
args
,
**
kwargs
):
if
self
.
sem
.
locked
():
return
spawn_greenlet
(
self
.
execute
,
func
,
*
args
,
**
kwargs
)
return
greenlet
.
spawn
(
self
.
execute
,
func
,
*
args
,
**
kwargs
)
else
:
return
self
.
execute
(
func
,
*
args
,
**
kwargs
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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