Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous file handling #72

Merged
merged 6 commits into from
Mar 31, 2021
Merged

Asynchronous file handling #72

merged 6 commits into from
Mar 31, 2021

Conversation

thekid
Copy link
Member

@thekid thekid commented Mar 31, 2021

This pull request makes handling files, including ranges, interruptible as described here. This way, file downloads will not block the entire server.

Using this Download class:

use web\Application;
use web\handler\FilesFrom;

class Download extends Application {

  public function routes() {
    return ['/' => new FilesFrom('.')];
  }
}

...and starting the server with -m async, we can see how two parallel downloads can run simultaneously:

image

@thekid thekid merged commit 1c63903 into master Mar 31, 2021
@thekid thekid deleted the refactor/async-files branch March 31, 2021 18:03
@thekid
Copy link
Member Author

thekid commented Apr 1, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant