Skip to content

Commit 93d64e9

Browse files
committed
Tweak debouncing wording a bit more.
1 parent 3bef667 commit 93d64e9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/source/examples/Widget Events.ipynb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,11 @@
360360
"source": [
361361
"## Debouncing\n",
362362
"\n",
363-
"When trait changes trigger a callback that performs a heavy computation, you may want to do the computation as rarely as possible. For instance, if the trait is driven by a slider which has its `continuous_update` set to `True`, the user will trigger a bunch of computations in rapid succession. Debouncing solves this problem by waiting for some time any time the trait value has changed to see if it is going to change again, in which case the callback is not called. If the value does not change after some time, then the callback is called with the last value of the trait. The effect is that the callback is only called when the trait pauses changing for a certain amount of time.\n",
363+
"When trait changes trigger a callback that performs a heavy computation, you may want to not do the computation as often as the value is updated. For instance, if the trait is driven by a slider which has its `continuous_update` set to `True`, the user will trigger a bunch of computations in rapid succession.\n",
364364
"\n",
365-
"Debouncing can be implemented using threads or asynchronous programming. We show an asynchronous solution below, which is more suited for ipywidgets. If you would like to instead use threads to do the debouncing, replace the `Timer` class with `from threading import Timer`."
365+
"Debouncing solves this problem by delaying callback execution until the value has not changed for a certain time, after which the callback is called with the latest value. The effect is that the callback is only called when the trait pauses changing for a certain amount of time.\n",
366+
"\n",
367+
"Debouncing can be implemented using an asynchronous loop or threads. We show an asynchronous solution below, which is more suited for ipywidgets. If you would like to instead use threads to do the debouncing, replace the `Timer` class with `from threading import Timer`."
366368
]
367369
},
368370
{
@@ -528,7 +530,7 @@
528530
"name": "python",
529531
"nbconvert_exporter": "python",
530532
"pygments_lexer": "ipython3",
531-
"version": "3.8.1"
533+
"version": "3.7.3"
532534
}
533535
},
534536
"nbformat": 4,

0 commit comments

Comments
 (0)