File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,6 @@ def __repr__(self) -> str:
167
167
BufferEventHandler = Callable [["Buffer" ], None ]
168
168
BufferAcceptHandler = Callable [["Buffer" ], bool ]
169
169
170
- BufferHistoryLock = threading .Lock ()
171
170
172
171
173
172
class Buffer :
Original file line number Diff line number Diff line change @@ -112,13 +112,11 @@ def __init__(self, history: History) -> None:
112
112
super ().__init__ ()
113
113
114
114
def load (self , item_loaded_callback : Callable [[str ], None ]) -> None :
115
- """Collect the history strings but run the callback in the event loop.
115
+ """Collect the history strings on a background thread,
116
+ but run the callback in the event loop.
116
117
117
- That's the only way to avoid multitasking hazards if the loaded history is large.
118
- Callback into `Buffer` tends to get working_index all tangled up.
119
-
120
- Caller of ThreadedHistory must ensure that the prompt ends up running on the same
121
- event loop as we create here.
118
+ Caller of ThreadedHistory must ensure that the Application ends up running on the same
119
+ event loop as we (probably) create here.
122
120
"""
123
121
124
122
self ._item_loaded_callbacks .append (item_loaded_callback )
You can’t perform that action at this time.
0 commit comments