lucid-kv / lucid

High performance and distributed KV store w/ REST API. 🦀
https://clintnetwork.gitbook.io/lucid/
MIT License
373 stars 31 forks source link

Implement Server Sent Events #60

Closed imclint21 closed 4 years ago

imclint21 commented 4 years ago

Hey,

This is the first base of the SSE implementation!

Kind regards

imclint21 commented 4 years ago

@CephalonRho, for SSE I use written this, we need to ensure that SEE is covered by JWT authentication if it's enabled, what I need to add below?

let sse = warp::path("notifications")
    .and(warp::get())
    .map(|| {
        warp::sse::reply(warp::sse::keep_alive()
            .stream(sse_events()))
    })
    .and(sse_enabled);

PS: sometimes we have verify_auth, sometimes check_webui I think that we need to uniform this!

imclint21 commented 4 years ago

It works! (like said Apache)

Just some things to change:

An example of empty events:

Capture d’écran 2020-03-17 à 23 44 13
imclint21 commented 4 years ago

I Merge #60 to create a Lucid PoC.