diff options
| author | Pierre Ossman (ThinLinc team) <ossman@cendio.se> | 2024-03-11 19:43:30 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-11 19:43:30 (GMT) |
| commit | 1d0d49a7e86257ff95b4de0685e6997d7533993c (patch) | |
| tree | 57b29921aa8502024674411fb495cc9dfaacaadd /Lib/asyncio/events.py | |
| parent | 872c0714fcdc168ce4a69bdd0346f2d5dd488ec2 (diff) | |
| download | cpython-1d0d49a7e86257ff95b4de0685e6997d7533993c.zip cpython-1d0d49a7e86257ff95b4de0685e6997d7533993c.tar.gz cpython-1d0d49a7e86257ff95b4de0685e6997d7533993c.tar.bz2 | |
gh-113538: Add asycio.Server.{close,abort}_clients (#114432)
These give applications the option of more forcefully terminating client
connections for asyncio servers. Useful when terminating a service and
there is limited time to wait for clients to finish up their work.
Diffstat (limited to 'Lib/asyncio/events.py')
| -rw-r--r-- | Lib/asyncio/events.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index 6807493..be49546 100644 --- a/Lib/asyncio/events.py +++ b/Lib/asyncio/events.py @@ -175,6 +175,14 @@ class AbstractServer: """Stop serving. This leaves existing connections open.""" raise NotImplementedError + def close_clients(self): + """Close all active connections.""" + raise NotImplementedError + + def abort_clients(self): + """Close all active connections immediately.""" + raise NotImplementedError + def get_loop(self): """Get the event loop the Server object is attached to.""" raise NotImplementedError |
