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
adc16775
Commit
adc16775
authored
Jul 21, 2009
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proc: Proc.kill now supports wait parameter and is async by default
parent
9040b8ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
gevent/proc.py
gevent/proc.py
+7
-12
No files found.
gevent/proc.py
View file @
adc16775
...
...
@@ -589,19 +589,14 @@ class Proc(Source):
throw_args
=
(
ProcExit
,
)
self
.
greenlet
.
throw
(
*
throw_args
)
def
kill
(
self
,
*
throw_args
):
"""Raise an exception in the greenlet. Unschedule the current greenlet
so that this Proc can handle the exception (or die).
The exception can be specified with throw_args. By default, ProcExit is
raised.
"""
def
kill
(
self
,
exception
=
ProcExit
,
wait
=
False
):
if
not
self
.
dead
:
if
not
throw_args
:
throw_args
=
(
ProcExit
,
)
core
.
active_event
(
self
.
greenlet
.
throw
,
*
throw_args
)
if
greenlet
.
getcurrent
()
is
not
greenlet
.
get_hub
().
greenlet
:
greenlet
.
sleep
(
0
)
core
.
active_event
(
self
.
greenlet
.
throw
,
exception
)
if
wait
:
try
:
self
.
wait
()
except
:
pass
# QQQ maybe Proc should not inherit from Source (because its send() and send_exception()
# QQQ methods are for internal use only)
...
...
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