actix / actix/actix-web

`HttpServer::new` should support asynchronous application factories

Aperta
#2,668 1 commento 2 reazioni 0 assegnatari Vedi su GitHub
RFC / Proposal
Lingua principale
Rust
Stelle
24.8k
Fork
1.9k
Merge medio
23h 10m
PR unite (30g)
26

Descrizione

## Expected Behavior
`HttpServer::new` should support asynchronous application factories as the argument.

## Current Behavior
```rust
HttpServer::new(move || async move { ... });
```
fails.

## Possible Solution
We either add `new_async` method or somehow make `new` work for both sync and async (if possible).

## Context
I tried to allocate a thread object whose allocator uses an async method. It failed and now I don't know what to do.

## Your Environment

- Rust Version: 1.58.1
- Actix Web Version: 4.0.0-rc.1

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.