twisted / twisted/twisted

asynchronous, non-blocking file I/O

Open
#3,983 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core enhancement new priority-low
Dominant language
Python
Stars
6k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
10

Description

glyph's avatar @glyph reported
Trac ID trac#3983
Type enhancement
Created 2009-08-27 01:37:55Z

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.)

Searchable metadata
trac-id__3983 3983
type__enhancement enhancement
reporter__glyph glyph
priority__low low
milestone__ 
branch__ 
branch_author__ 
status__new new
resolution__None None
component__core core
keywords__ 
time__1251337075000000 1251337075000000
changetime__1363352220000000 1363352220000000
version__None None
owner__ 
cc__detly cc__yac cc__jamesbroadhead cc__oberstet

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading twisted.protocols.basic.FileSender and compare it with the proposed subprocess, thread, timer, or combined approaches. The work would need a decided official non-blocking filesystem API, including behavior for tail-like monitoring and completion detection.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.