Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 46 additions & 9 deletions esrally/client/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,62 @@
from esrally.utils import io, versions


class StaticTransport:
def __init__(self):
self.closed = False
class StaticTransport(asyncio.Transport):
def __init__(self, protocol: asyncio.Protocol):
self._closed = False
self._protocol = protocol
super().__init__()

def is_closing(self):
def abort(self):
self.close()

def can_write_eof(self):
return False

def close(self):
self.closed = True
self._closed = True
# allows immediate connection closure, without creating closed future
# see https://github.com/aio-libs/aiohttp/pull/11107
self._protocol.connection_lost(None)

def abort(self):
self.close()
def get_protocol(self):
return self._protocol

def get_write_buffer_limits(self):
return (0, 0)

def get_write_buffer_size(self):
return 0

def is_closing(self):
return self._closed

def is_reading(self):
return False

def pause_reading(self):
pass

def resume_reading(self):
pass

def set_protocol(self, protocol):
self._protocol = protocol

def set_write_buffer_limits(self, high=None, low=None):
pass

def write(self, data):
pass

def write_eof(self):
pass


class StaticConnector(BaseConnector):
async def _create_connection(self, req: "ClientRequest", traces: list["Trace"], timeout: "ClientTimeout") -> ResponseHandler:
handler = ResponseHandler(self._loop)
handler.transport = StaticTransport()
handler.protocol = ""
handler.transport = StaticTransport(handler)
return handler


Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ dependencies = [
# License: MIT
"urllib3==1.26.19",
# License: Apache 2.0
"aiohttp==3.10.11",
"aiosignal==1.3.2",
"aiohttp==3.13.3",
"aiosignal==1.4.0",
"docker==6.0.0",
# avoid specific requests version to fix bug in docker-py
"requests<2.32.0",
Expand Down
Loading