Skip to content

Commit

Permalink
access.direct.demultiplexer: add writev.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Apr 20, 2024
1 parent 48d57a3 commit a88139a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions software/glasgow/access/direct/demultiplexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ async def _out_task(self, data):
self._out_tasks.submit(self._out_task(self._out_slice()))

async def write(self, data):
await self.writev([data])

async def writev(self, datav):
if self._write_buffer_size is not None:
# If write buffer is bounded, and we have more inflight requests than the configured
# write buffer size, then wait until the inflight requests arrive before continuing.
Expand All @@ -313,8 +316,9 @@ async def write(self, data):
# Eagerly check if any of our previous queued writes errored out.
await self._out_tasks.poll()

self.logger.trace("FIFO: write <%s>", dump_hex(data))
self._out_buffer.write(data)
for data in datav:
self.logger.trace("FIFO: write <%s>", dump_hex(data))
self._out_buffer.write(data)

# The write scheduling algorithm attempts to satisfy several partially conflicting goals:
# * We want to schedule writes as early as possible, because this reduces buffer bloat and
Expand Down

0 comments on commit a88139a

Please sign in to comment.