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

add HttpServer::new_async #2413

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aliemjay
Copy link
Member

PR Type

Feature

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

Closes #2286

@aliemjay
Copy link
Member Author

Depends on actix/actix-net#397

FnOnce was chosen for the closure because otherwise it would be incovenient to use - the users are required to clone captures before the async block:

HttpServer::new_async(move || {
    let data = data.clone();
    async move { App::new().data(data) }
})

HttpServer::new was relaxed to accept FnOnce too for consistency.

@robjtede robjtede added this to the actix-web post-v4 milestone Nov 25, 2021
@robjtede
Copy link
Member

not pursuing async server builders this cycle so delaying this til post v4

@robjtede robjtede marked this pull request as draft December 4, 2021 19:41
@robjtede robjtede removed this from the actix-web post-v4 milestone Mar 1, 2022
@aliemjay aliemjay force-pushed the web/feat/httpserver-new-async branch from 33ce81a to 4b098d3 Compare March 29, 2022 17:39
@aliemjay aliemjay added B-semver-major breaking change requiring a major version bump A-web project: actix-web labels Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web project: actix-web B-semver-major breaking change requiring a major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

async HttpServer::new as alternative to data_factory
2 participants