Coder Social home page Coder Social logo

lemon-mint / flask-event-server Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 98 KB

flask-event-server Is minimal and unoptimized Server-Sent Events Server

License: Mozilla Public License 2.0

Python 42.60% Dockerfile 1.42% HTML 52.29% JavaScript 3.69%

flask-event-server's Introduction

Deprecated

This project was discontinued due to internal structural problems. Please check lemon-mint/event-broker

flask-event-server

flask-event-server Is minimal and unoptimized Server-Sent Events Server

stable

buildstate

dev version

build-dev-latest

APIS

/sse/listen/<sha384 hash of channel name>

example code

function makeconn() {
    var evt = new EventSource('/sse/listen/cf2daa804389e2eedd4fdc41e32e1f481a5ec493b956ece1d4d0fa2427188636bfe0b1abc462677e54b1d8d7447bc494');
    evt.addEventListener('open', function (e) {
        console.log('connected');
    }, false);
    evt.addEventListener('myevent', function (e) {
        console.log(e);
    }, false);
    evt.addEventListener('error', function (e) {
        evt.close();
        makeconn();
    }, false);
}
makeconn();

/sse/deploy/<channel name>

GET /sse/deploy/mychannel?type=myevent&sub=1000

{"eventid":"ab7dca31b9dea1bebf5e","sub":1000,"success":true,"time":1604566637.6499722}

/calc/<channel name>

Calculate the sha384 value of the channel name.

GET /calc/mychannel

cf2daa804389e2eedd4fdc41e32e1f481a5ec493b956ece1d4d0fa2427188636bfe0b1abc462677e54b1d8d7447bc494

flask-event-server's People

Contributors

lemon-mint avatar

Stargazers

 avatar

Watchers

 avatar

flask-event-server's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.