lunatic-solutions / submillisecond

A lunatic web framework
MIT License
912 stars 18 forks source link

Add captures to websocket upgrade callback #84

Closed tqwewe closed 2 years ago

tqwewe commented 2 years ago

Adds support to share captured variables to spawned process in websocket upgrades.

https://github.com/lunatic-solutions/submillisecond/blob/632d4ebb3a0870df82bb1b6c6a1fbbdb849295be/examples/websocket.rs#L5-L8

This could be another function, such as .on_upgrade_with_captures, but it feels to verbose at that point.