drogonframework / drogonframework/drogon

Support async for WebSocketController

Open
#2,445 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 13h
Merged PRs (30d)
14

Description

**Is your feature request related to a problem? Please describe.**
I checked the [FunctionTraits.h](https://github.com/drogonframework/drogon/blob/master/lib/inc/drogon/utils/FunctionTraits.h) code, and noticed there are no traits to add WebSocketController children so it supports Task<> returns and make them coroutines like HttpController.

Is that possible?

**Describe the solution you'd like**
Update the traits so WebSocketController supports coroutines and be made async like HttpController.

**Describe alternatives you've considered**
I've found no alternatives inside the library.

**Additional context**
I leverage coroutines and use all asynchronous endpoints, but as I start using WebSockets for VelocityPack message streaming, I noticed it's blocking, and I would prefer to have all my drogon workers not get constantly blocked.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.