I’ve noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)
Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active
It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.
Does anyone know about this limit? Can I speed up the button read?
So button press events are currently handled in a bit of a hacky way, by treating them as standard Bokeh model property updates. It's been proposed to add a real "event" message type for fire-and-forget type events like this. Presumably they would be trivial to consruct, send, and decode, which might explain this situation. That is just a speculation at this point, however.
I've noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)
Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active
It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.
Does anyone know about this limit? Can I speed up the button read?
Interesting. The same behavior is also repeated with text input.
Is there anyway for me to hack together an event fire or at least an "on click" event to force the button read on time?
···
Sent from my iPhone
On Mar 8, 2016, at 8:06 PM, Bryan Van de Ven <[email protected]> wrote:
So button press events are currently handled in a bit of a hacky way, by treating them as standard Bokeh model property updates. It's been proposed to add a real "event" message type for fire-and-forget type events like this. Presumably they would be trivial to consruct, send, and decode, which might explain this situation. That is just a speculation at this point, however.
I've noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)
Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active
It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.
Does anyone know about this limit? Can I speed up the button read?
An "event" message is not difficult in principle, but it will necessitate new code at the foundation of the protocol machinery, so any change there will need excessive new tests. But as I said it's only speculation, and now reading your first message again I am not so sure that's what you are describing. What exactly do you mean when you say you "can only pick up the state"? Are you saying there is an exception? Or None is returned? Or? As always, a runnable code example will go a very long way towards helping any diagnosis or investigation.
Interesting. The same behavior is also repeated with text input.
Is there anyway for me to hack together an event fire or at least an "on click" event to force the button read on time?
Sent from my iPhone
On Mar 8, 2016, at 8:06 PM, Bryan Van de Ven <[email protected]> wrote:
So button press events are currently handled in a bit of a hacky way, by treating them as standard Bokeh model property updates. It's been proposed to add a real "event" message type for fire-and-forget type events like this. Presumably they would be trivial to consruct, send, and decode, which might explain this situation. That is just a speculation at this point, however.
I've noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)
Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active
It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.
Does anyone know about this limit? Can I speed up the button read?
Suppose i have a radio button with 2 states- 0 and 1.
The button is initialized to state zero. I start the callback loop, 100ms update. Inside the loop i print the button state: button.active
I then switch the button state to 1. The button state printout doesnt change for at least 10-20 seconds.
So in code this would be something like this
Radio Button def (right out of the bokeh docs)
Def update(t):
Print button.active
Callback(update(),100)
···
Sent from my iPhone
On Mar 8, 2016, at 9:33 PM, Bryan Van de Ven <[email protected]> wrote:
An "event" message is not difficult in principle, but it will necessitate new code at the foundation of the protocol machinery, so any change there will need excessive new tests. But as I said it's only speculation, and now reading your first message again I am not so sure that's what you are describing. What exactly do you mean when you say you "can only pick up the state"? Are you saying there is an exception? Or None is returned? Or? As always, a runnable code example will go a very long way towards helping any diagnosis or investigation.
Interesting. The same behavior is also repeated with text input.
Is there anyway for me to hack together an event fire or at least an "on click" event to force the button read on time?
Sent from my iPhone
On Mar 8, 2016, at 8:06 PM, Bryan Van de Ven <[email protected]> wrote:
So button press events are currently handled in a bit of a hacky way, by treating them as standard Bokeh model property updates. It's been proposed to add a real "event" message type for fire-and-forget type events like this. Presumably they would be trivial to consruct, send, and decode, which might explain this situation. That is just a speculation at this point, however.
I've noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)
Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active
It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.
Does anyone know about this limit? Can I speed up the button read?
print " Button Group State: " +str(button_group.active)
button_group = RadioButtonGroup(
labels=["State 1", "State 2"], active=0)
# open a session to keep our local document in sync with server
session = push_session(curdoc())
curdoc().add_periodic_callback(update, 50)
session.show() # open the document in a browser
session.loop_until_closed() # run forever
This is in a bokeh server and there is a lot of other things going on but this is my minimal example.
···
On Tuesday, 8 March 2016 19:21:09 UTC-5, RedRaven wrote:
I’ve noticed an interesting problem. I have a callback that reads every 150ms. => callback(update(),150)
Inside this callback function I am reading a RadioButtonGroup => radiobuttongroup.active
It seems that i cannot read the button when the callback time is 150ms, I can only pick up the button state if the callback time is greater than 250ms.
Does anyone know about this limit? Can I speed up the button read?