-
Notifications
You must be signed in to change notification settings - Fork 322
[BREAKING CHANGE] Fixes: #90 Remove idle emulation from asyncio event loop #541
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
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.
urwid/display_common.py
Outdated
|
||
Instance is mutable -> use ID component. | ||
""" | ||
return hash((self.__class__, self._value, id(self))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Immutable AttrSpec would be a good change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
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__
)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 usedTornadoEventLoop
&AsyncioEventLoop
logic (Tornado IOLoop is asyncio based)For extra details see original PR.
Checklist
master
orpython-dual-support
branchtox
successfully in local environment