virto-network / valor

Create HTTP APIs with a plugin system that runs in the server and the browser.
GNU General Public License v3.0
9 stars 8 forks source link

Handling non HTTP messages #30

Closed olanod closed 3 years ago

olanod commented 3 years ago

Plugin writers should be able to add more than one handler that would process messages coming from an event bus or a different source of data. The one handler could also be just the custom message handler instead of an HTTP one.

// V1 HTTP request handler 
#[vlugin]
async fn http_handler(req: Request) -> Response {}

#[vlugin]
async fn my_data_handler(req: MyData) {}