Giter Site home page Giter Site logo

magix-war-plugin's People

Contributors

ingvord avatar

Watchers

 avatar  avatar

magix-war-plugin's Issues

Enhance SSE subscription by introducing magix-side filters

Currently Magix sends out all messages through SSE ignoring client preferences. As for now client Magix API implementation is responsible for filtering out messages by channel (event type in SSE). See RFC-2 and JS implementation

We can improve bandwidth usage a bit if during subscription to SSE endpoint client sends a list of desired ogrigins it wants to listen.

While Magix MUST simply drop messages from non-desired origins. See Magix implementation

Rough implementation:

@GET
@Path("/subscribe")
@Produces(MediaType.SERVER_SENT_EVENTS)
public void getStream(@Context SseEventSink sink, @QueryParam("origin", default = Empty) List<String> filters) {
        logger.debug("Subscribing new client...");
        broadcaster.register(sink, filters);//implement broadcaster wrapper
}
//in broadcaster.broadcast
if Incoming message.origin is in client origins - send, otherwise ignore

And the request:

GET http://localhost:8080/magix/api/subscribe?origin=tango&origin=data_forge

Pros

  • save bandwidth

Cons

  • Magix SHOULD process messages

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.