New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger Python event when `level_of_detail` mode finishes #3748

Closed
jdugge opened this Issue Jan 26, 2016 · 4 comments

Comments

@jdugge

jdugge commented Jan 26, 2016

It would be great if the Python script on a Bokeh server could be notified once a level_of_detail mode in the client (on zoom or pan) finishes, since this can be an appropriate point at which to generate updated data.

@bryevdv

This comment has been minimized.

Show comment
Hide comment
@bryevdv

bryevdv Jan 26, 2016

Member

This seems reasonable, but I think we first need to build out a little capability for "events" that are not model attribute updates. E.g. we currently clumsily record button presses as an attribute state change, but buttons, and things like this should really be separate fire-and-forget type events back to the server, not model state updates. Thoughts @havocp ?

Member

bryevdv commented Jan 26, 2016

This seems reasonable, but I think we first need to build out a little capability for "events" that are not model attribute updates. E.g. we currently clumsily record button presses as an attribute state change, but buttons, and things like this should really be separate fire-and-forget type events back to the server, not model state updates. Thoughts @havocp ?

@havocp

This comment has been minimized.

Show comment
Hide comment
@havocp

havocp Jan 26, 2016

Contributor

A simple version that might require only one new websocket message could be along these lines...

class Model:
    def emit_event(self, name, args):
         """Broadcast an event with the given name and dict of args.

         The args dict cannot contain models, only plain old data.
         """
         pass
   def on_event(self, name, callback):
        """Register a callback to receive events with the given name and their args.
        """

On the Document and wire protocol level, there could be some kind of ModelEventEvent (better name possible), which would serialize the event name and args... so there's one new websocket message that has name and args in it.

Contributor

havocp commented Jan 26, 2016

A simple version that might require only one new websocket message could be along these lines...

class Model:
    def emit_event(self, name, args):
         """Broadcast an event with the given name and dict of args.

         The args dict cannot contain models, only plain old data.
         """
         pass
   def on_event(self, name, callback):
        """Register a callback to receive events with the given name and their args.
        """

On the Document and wire protocol level, there could be some kind of ModelEventEvent (better name possible), which would serialize the event name and args... so there's one new websocket message that has name and args in it.

@bryevdv bryevdv added this to the short-term milestone Jan 27, 2016

@bryevdv bryevdv self-assigned this Jan 27, 2016

@bryevdv

This comment has been minimized.

Show comment
Hide comment
@bryevdv

bryevdv Jan 27, 2016

Member

@havocp that seems pretty reasonable, I've re-marked this as a feature.

Member

bryevdv commented Jan 27, 2016

@havocp that seems pretty reasonable, I've re-marked this as a feature.

@bryevdv

This comment has been minimized.

Show comment
Hide comment
@bryevdv

bryevdv Mar 15, 2017

Member

This was closed by #5941

Member

bryevdv commented Mar 15, 2017

This was closed by #5941

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment