Opened 5 years ago

Last modified 19 months ago

#3983 enhancement new

asynchronous, non-blocking file I/O

Reported by: glyph Owned by:
Priority: low Milestone:
Component: core Keywords:
Cc: jason.heeris@…, yac@…, jamesbroadhead@…, tobias.oberstein@… Branch:
Author: Launchpad Bug:

Description

Twisted should have an official API for (at least notionally) non-blocking filesystem input and output.

This may not be possible without cheating a little bit, because asynchronous file I/O support is not really there in most operating systems. However, we could:

  1. do the file I/O in a subprocess
  2. do the file I/O in a thread (one thread per mount point? a threadpool?)
  3. just block, with timers, but present an API which would be amenable to non-blocking later. (Possibly, this strategy is already partially satisfied by twisted.protocols.basic.FileSender.)
  4. some combination of these, with a back-end that could be selected somehow

Something that FileSender does not satisfy is some equivalent to 'tail -f'; allowing a Twisted program to easily and non-blockingly monitor the log or file output of another program as if it were coming from a socket. This is somewhat tricky to do in the general case, since it's hard to detect when the log or file is done being written. Still there are heuristics (wait until this process has died, wait until this other file has disappeared) which could provide a useful substitute for certainty of connectionLost.

(I will be surprised if this is not a duplicate of something, but searches yield nothing.)

Change History (6)

comment:1 Changed 5 years ago by exarkun

You may have been thinking of Specification/AsynchronousFileInputOutput.

comment:2 Changed 4 years ago by <automation>

  • Owner glyph deleted

comment:3 Changed 4 years ago by detly

  • Cc jason.heeris@… added

comment:4 Changed 2 years ago by yac

  • Cc yac@… added

comment:5 Changed 20 months ago by jamesbroadhead

  • Cc jamesbroadhead@… added

comment:6 Changed 19 months ago by oberstet

  • Cc tobias.oberstein@… added
Note: See TracTickets for help on using tickets.