Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/benoitc/gunicorn
/ functions
Functions
4,571 in github.com/benoitc/gunicorn
⨍
Functions
4,571
◇
Types & classes
1,022
↳
Endpoints
130
↓ 13 callers
Method
execute_async
Execute an action on a dirty app (async/non-blocking). Args: app_path: Import path of the dirty app action:
gunicorn/dirty/client.py:223
↓ 13 callers
Method
feed_eof
Signal that the connection has been closed.
gunicorn/asgi/websocket.py:95
↓ 13 callers
Method
fileno
(self)
gunicorn/workers/workertmp.py:49
↓ 13 callers
Function
load_dirty_app
Load a dirty app class from an import path. Args: import_path: String in format 'module.path:ClassName' Returns: An ins
gunicorn/dirty/app.py:215
↓ 13 callers
Method
stream_async
Stream results from a dirty app action (async). This method returns an async iterator that yields chunks from a streaming re
gunicorn/dirty/client.py:279
↓ 13 callers
Method
write
(self, data)
tests/test_dirty_worker.py:61
↓ 13 callers
Method
write_message
Write one message to a socket. Args: sock: Socket to write to data: Message dictionary to send
gunicorn/ctl/protocol.py:121
↓ 12 callers
Method
_get_reason_phrase
Get HTTP reason phrase for status code.
gunicorn/asgi/protocol.py:1423
↓ 12 callers
Method
close
(self)
tests/dirty/test_client_streaming.py:51
↓ 12 callers
Method
debug
(self, msg, *args, **kwargs)
gunicorn/glogging.py:289
↓ 12 callers
Function
drain_body
Drain the request body.
tests/docker/asgi_compliance/apps/http_app.py:578
↓ 12 callers
Method
handle_exit
(self, sig, frame)
gunicorn/workers/base.py:185
↓ 12 callers
Function
make_error_response
Create an error response message. Args: request_id: Request identifier being responded to error: Error message Returns:
gunicorn/ctl/protocol.py:209
↓ 12 callers
Function
parse_dirty_app_spec
Parse a dirty app specification. Supports two formats: - ``"module:Class"`` - standard format, all workers load the app - ``"module:
gunicorn/dirty/app.py:140
↓ 12 callers
Method
read_message_async
Read one message from an async reader. Args: reader: asyncio StreamReader Returns: Decoded message
gunicorn/ctl/protocol.py:133
↓ 12 callers
Method
recv
(self, length=None)
tests/t.py:51
↓ 12 callers
Method
start
\ Initialize the arbiter. Start listening and set pidfile if needed.
gunicorn/arbiter.py:166
↓ 12 callers
Method
update_priority
Update stream priority from PRIORITY frame. Args: weight: Priority weight (1-256), higher = more resources depends_on
gunicorn/http2/stream.py:254
↓ 11 callers
Method
_build_http2_scope
Build ASGI HTTP scope from HTTP/2 request.
gunicorn/asgi/protocol.py:1744
↓ 11 callers
Method
_close_transport
Close the transport safely. Calls write_eof() first if supported to signal end of writing, which helps ensure buffered data is flushe
gunicorn/asgi/protocol.py:1462
↓ 11 callers
Function
_get_client
Get or create a thread-local stash client.
gunicorn/dirty/stash.py:439
↓ 11 callers
Method
clear
Delete all entries.
gunicorn/dirty/stash.py:392
↓ 11 callers
Method
connect
Establish sync socket connection to arbiter. Raises: DirtyConnectionError: If connection fails
gunicorn/dirty/client.py:59
↓ 11 callers
Method
handle
(self, listener, client, addr)
gunicorn/workers/sync.py:134
↓ 11 callers
Function
make_stash_message
Build a stash operation message dict. Args: request_id: Unique request identifier (int or str) op: Stash operation code (STA
gunicorn/dirty/protocol.py:762
↓ 11 callers
Method
receive
ASGI receive callable - returns body chunks or disconnect.
gunicorn/asgi/protocol.py:213
↓ 11 callers
Method
send_command
Send command and wait for response. Args: command: Command string (e.g., "show workers") args: Optional addi
gunicorn/ctl/client.py:74
↓ 11 callers
Method
startup
Run lifespan startup and wait for completion. Raises: RuntimeError: If startup fails or app doesn't support lifespan
gunicorn/asgi/lifespan.py:53
↓ 10 callers
Method
_execute
Execute a stash operation. Args: op: Operation code (STASH_OP_*) table: Table name key: Optional
gunicorn/dirty/stash.py:137
↓ 10 callers
Method
access
Measure request duration request_time is a datetime.timedelta
gunicorn/instrument/statsd.py:96
↓ 10 callers
Method
clear_sent
(self)
tests/test_http2_integration.py:65
↓ 10 callers
Method
encode_header
Encode the 16-byte message header. Args: msg_type: Message type (MSG_TYPE_REQUEST, etc.) request_id: Unique
gunicorn/dirty/protocol.py:115
↓ 10 callers
Method
finish_body
Discard any unread body of the current message. Called before returning a keepalive connection to the poller so the socket does not a
gunicorn/http/parser.py:38
↓ 10 callers
Method
get_client
Create HTTP/2 client.
examples/http2_gevent/test_http2_gevent.py:59
↓ 10 callers
Method
get_gunicorn_pids
Get PIDs of gunicorn processes. Uses ps output with proctitle if available, otherwise falls back to process tree analysis.
tests/docker/dirty_arbiter/test_parent_death.py:132
↓ 10 callers
Method
get_sent_data
(self)
tests/test_early_hints.py:91
↓ 10 callers
Method
get_written_data
(self)
tests/test_http2_async_connection.py:83
↓ 10 callers
Method
getsockname
(self)
tests/test_gthread.py:53
↓ 10 callers
Method
handle_request
Handle a single request message. Supports both regular (non-streaming) and streaming responses. For streaming, detects if th
gunicorn/dirty/worker.py:315
↓ 10 callers
Method
info
(self, msg, *args)
examples/dirty_example/test_worker_integration.py:31
↓ 10 callers
Method
route_request
Route a request to an available dirty worker via queue. Each worker has a dedicated queue and consumer task. Requests are su
gunicorn/dirty/arbiter.py:445
↓ 10 callers
Method
stop
\ Stop workers :attr graceful: boolean, If True (the default) workers will be killed gracefully (ie. trying to wait for the
gunicorn/arbiter.py:443
↓ 10 callers
Method
values
Iterate over values.
gunicorn/dirty/stash.py:401
↓ 10 callers
Method
write_message_async
Write a message to async stream. Accepts dict format for backwards compatibility. Args: writer: asyncio StreamW
gunicorn/dirty/protocol.py:468
↓ 9 callers
Method
_build_environ
Build minimal WSGI-like environ dict for access logging.
gunicorn/asgi/protocol.py:1182
↓ 9 callers
Function
_cfg
(http_parser, **overrides)
tests/test_header_policy_parity.py:30
↓ 9 callers
Method
_is_websocket_upgrade
Check if request is a WebSocket upgrade. Per RFC 6455 Section 4.1, the opening handshake requires: - HTTP method MUST be GET
gunicorn/asgi/protocol.py:904
↓ 9 callers
Function
_parse
(raw, cfg, peer_addr)
tests/test_header_policy_parity.py:25
↓ 9 callers
Method
_read_exact
Read exactly size bytes from the unreader.
gunicorn/uwsgi/message.py:116
↓ 9 callers
Method
clear
(self)
tests/test_early_hints.py:94
↓ 9 callers
Method
close
Close the connection gracefully with GOAWAY. Args: error_code: HTTP/2 error code (default: NO_ERROR) last_stream_id:
gunicorn/http2/connection.py:610
↓ 9 callers
Method
close
Cleanup on shutdown.
examples/dirty_example/dirty_app.py:112
↓ 9 callers
Function
create_arbiter
Create a test arbiter with mocked components.
tests/dirty/test_arbiter_streaming.py:85
↓ 9 callers
Function
create_client_with_mock_socket
Create a client with a mock socket returning the given messages.
tests/dirty/test_client_streaming.py:55
↓ 9 callers
Function
drain_body
Drain the request body.
tests/docker/asgi_compliance/apps/streaming_app.py:471
↓ 9 callers
Method
get_header
Get a header value by name. Args: name: Header name (case-insensitive) Returns: str: Header value, or None i
gunicorn/http2/request.py:186
↓ 9 callers
Method
read
Read data from the body. Args: size: Number of bytes to read, or None for all remaining Returns: bytes: The
gunicorn/http2/request.py:33
↓ 9 callers
Method
readline
(self, size=None)
gunicorn/http/body.py:238
↓ 9 callers
Method
seek
(self, offset, whence=0)
tests/t.py:65
↓ 9 callers
Method
set_complete
Mark body as complete (called when message ends).
gunicorn/asgi/protocol.py:193
↓ 9 callers
Method
settimeout
(self, timeout)
benchmarks/dirty_streaming.py:541
↓ 9 callers
Method
signal
Signal handler - NO LOGGING, just queue the signal.
gunicorn/arbiter.py:238
↓ 9 callers
Method
signal_disconnect
Signal that the client transport has gone away.
gunicorn/asgi/protocol.py:198
↓ 9 callers
Method
start
Start the dirty arbiter and workers.
benchmarks/dirty_benchmark.py:217
↓ 9 callers
Method
stop
Stop the dirty arbiter.
benchmarks/dirty_benchmark.py:258
↓ 8 callers
Method
__init__
(self, message, details=None)
gunicorn/dirty/errors.py:15
↓ 8 callers
Method
_build_websocket_scope
Build ASGI WebSocket scope from parsed request.
gunicorn/asgi/protocol.py:1200
↓ 8 callers
Method
_cleanup_worker
Clean up after a worker exits. Saves the dead worker's app list to pending respawns so the replacement worker gets the same
gunicorn/dirty/arbiter.py:1015
↓ 8 callers
Method
_create_mock_request
Create a mock HTTP request.
tests/test_asgi_http_scope.py:665
↓ 8 callers
Method
_create_protocol
Create an ASGIProtocol instance for testing.
tests/test_asgi_http_scope.py:654
↓ 8 callers
Method
_create_protocol
Create a WebSocketProtocol instance for testing.
tests/test_asgi_websocket_protocol.py:748
↓ 8 callers
Method
_get_apps_for_new_worker
Determine which apps a new worker should load. Returns a list of import paths for apps that need more workers. Apps with wor
gunicorn/dirty/arbiter.py:172
↓ 8 callers
Method
_get_available_worker
Get an available worker PID using round-robin selection. If app_path is provided, only returns workers that have loaded that
gunicorn/dirty/arbiter.py:587
↓ 8 callers
Method
_get_minimum_workers
Calculate minimum number of workers required by app specs. Returns the maximum worker_count across all apps that have limits.
gunicorn/dirty/arbiter.py:155
↓ 8 callers
Method
clear
(self)
tests/test_http2_async_connection.py:86
↓ 8 callers
Method
close
Close the sync connection.
gunicorn/dirty/client.py:188
↓ 8 callers
Method
close
Cleanup resources. Called when the dirty worker is shutting down. Use this to release resources like database connections, u
gunicorn/dirty/app.py:131
↓ 8 callers
Method
close
(self)
tests/test_asgi_worker.py:55
↓ 8 callers
Method
connect
Connect to control socket. Raises: ControlClientError: If connection fails
gunicorn/ctl/client.py:47
↓ 8 callers
Function
create_async_client_with_mocks
Create a client with mock async reader/writer.
tests/dirty/test_client_streaming_async.py:60
↓ 8 callers
Method
create_worker
Create a worker instance for testing.
tests/test_gthread.py:236
↓ 8 callers
Method
execute
Execute an action on a dirty app (sync/blocking). Args: app_path: Import path of the dirty app (e.g., 'myapp.ml:MLApp')
gunicorn/dirty/client.py:80
↓ 8 callers
Method
http_get
Make HTTP GET request to the container.
tests/docker/per_app_allocation/test_per_app_e2e.py:186
↓ 8 callers
Method
info
(self, msg, *args, **kwargs)
gunicorn/instrument/statsd.py:61
↓ 8 callers
Method
last_update
(self)
gunicorn/workers/workertmp.py:46
↓ 8 callers
Method
notify
\ Your worker subclass must arrange to have this method called once every ``self.timeout`` seconds. If you fail in accomplishing
gunicorn/workers/base.py:70
↓ 8 callers
Method
read_into
Read data from unreader and append to bytearray buffer.
gunicorn/http/message.py:625
↓ 8 callers
Method
stream_chunks
Stream response chunks from URL.
tests/docker/asgi_compliance/conftest.py:337
↓ 8 callers
Method
wait_closed
(self)
tests/test_dirty_worker.py:87
↓ 8 callers
Method
wsgi
(self)
gunicorn/app/base.py:64
↓ 7 callers
Method
_close_worker_connection
Close connection to a worker.
gunicorn/dirty/arbiter.py:650
↓ 7 callers
Method
_create_manager
Create a LifespanManager instance.
tests/test_asgi_lifespan.py:121
↓ 7 callers
Method
_create_mock_request
Create a mock WebSocket upgrade request.
tests/test_asgi_http_scope.py:368
↓ 7 callers
Method
_create_mock_request
Create a mock HTTP request.
tests/test_asgi_websocket_protocol.py:437
↓ 7 callers
Method
_create_protocol
Create an ASGIProtocol instance for testing.
tests/test_asgi_http_scope.py:357
↓ 7 callers
Method
_create_protocol
Create an ASGIProtocol instance for testing.
tests/test_asgi_websocket_protocol.py:425
↓ 7 callers
Method
_handle_http_request
Handle a single HTTP request.
gunicorn/asgi/protocol.py:942
↓ 7 callers
Function
_normalize_sockaddr
Normalize socket address to ASGI-compatible (host, port) tuple. ASGI spec requires server/client to be (host, port) tuples. IPv6 sockets retu
gunicorn/asgi/protocol.py:41
↓ 7 callers
Method
_omits
(self, method, status)
tests/test_asgi_streaming.py:354
↓ 7 callers
Method
_signal_handler
Handle signals.
gunicorn/dirty/arbiter.py:280
← previous
next →
101–200 of 4,571, ranked by callers