Skip to content

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.

2 participants