Repository navigation
[BREAKING CHANGE] Fixes: #90 Remove idle emulation from asyncio event loop - #541
Conversation
…ent loop Re-implement abandoned PR urwid#418 * Fix "not hashable `AttrSpec`" and it's instance creation price (use `__slots__`) `AttrSpec` instances may be created in huge amount, with slots this process consume less resources. * `Terminal` is always created with event loop, if not provided -> `SelectEventLoop` is used * Fixed `TornadoEventLoop` & `AsyncioEventLoop` logic (Tornado IOLoop is asyncio based) For extra details see original PR.
|
|
||
| Instance is mutable -> use ID component. | ||
| """ | ||
| return hash((self.__class__, self._value, id(self))) |
There was a problem hiding this comment.
if _value is mutable should it be used for computing a __hash__? Won't this cause a problem if it's used as a key in a dict then modified?
There was a problem hiding this comment.
It's made like done by "unsafe hash" in python data classes. Making instance id specific (not recalculated) hash maybe also solution.
Hash is required for terminal example app.
There was a problem hiding this comment.
interesting, I didn't know about that. Is it worth mentioning this expected unsafe behavior or the reason for adding __hash__ in the docstring?
There was a problem hiding this comment.
I'll add mention in docstring and will recheck repository for mutation calls. If will be possible - will change it to immutable.
There was a problem hiding this comment.
Immutable AttrSpec would be a good change
|
does this change allow handling multiple input/resize events before the screen is redrawn so that the application can "catch up" quickly? |
In my test runs it was quick enough during filesystem browse and no issues on widget replacement. |
|
A test I used to do was steadily drag the terminal window size so the input would fill up with resize events. If the redraw is happening between each event then after you stop resizing the application will take an arbitrarily long time to catch up and be responsive again. If the redraw happens at the end of handling input events then the application will be almost immediately responsive. |
For me after ~30 seconds of nonstop resize terminal example worked immediately on |
Co-authored-by: Ian Ward <ian@excess.org>
upgrading urwid to 2.2.0 breaks dnet in two ways: * ui is not visible unless the terminal is in focus * the screen is not redrawing correctly- contains artifacts from previous draw. it may have to do with this breaking change that was added to 2.2.0: urwid/urwid#541 but i am not sure yet, investigating.
upgrading urwid to 2.2.0 breaks dnet in two ways: * ui is not visible unless the terminal is in focus * the screen is not redrawing correctly- contains artifacts from previous draw. it may have to do with this breaking change that was added to 2.2.0: urwid/urwid#541 but i am not sure yet, investigating.
upgrading urwid to 2.2.0 breaks dnet in two ways: * ui is not visible unless the terminal is in focus * the screen is not redrawing correctly- contains artifacts from previous draw. it may have to do with this breaking change that was added to 2.2.0: urwid/urwid#541 but i am not sure yet, investigating.
Re-implement abandoned PR #418
AttrSpec" and it's instance creation price (use__slots__)AttrSpecinstances may be created in huge amount, with slots this process consume less resources.Terminalis always created with event loop, if not provided ->SelectEventLoopis usedTornadoEventLoop&AsyncioEventLooplogic (Tornado IOLoop is asyncio based)For extra details see original PR.
Checklist
masterorpython-dual-supportbranchtoxsuccessfully in local environment