Comments (5)
Yeah, I suspected that my clean up logic was not good.
Issue in async python REPL server, we expose it on separate port so user can directly connect and bypass regular aiomonitor. It is hard to make proper clean up here. One solution is disable this bypassing feature and start and stop server on demand.
from aiomonitor.
are you calling close()
method inside coroutine?
from aiomonitor.
This is the complete module in which I start and stop aiomonitor:
from aiomonitor import Monitor, MONITOR_PORT, CONSOLE_PORT
from asphalt.core import Component, Context, context_teardown
class AIOMonitorComponent(Component):
def __init__(self, host: str = '0.0.0.0', port: int = MONITOR_PORT,
console_port: int = CONSOLE_PORT, console_enabled: bool = True) -> None:
self.host = host
self.port = port
self.console_port = console_port
self.console_enabled = console_enabled
@context_teardown
async def start(self, ctx: Context):
with Monitor(ctx.loop, host=self.host, port=self.port, console_port=self.console_port,
console_enabled=self.console_enabled):
yield
On aiomonitor 0.3.1, this works fine.
from aiomonitor.
0.3.1 did not close resources correctly as results tests were unstable... I never designed monitor to start inside coroutine. I think there should be separate API for async mode.
from aiomonitor.
This PR should fix an issue #175
I decided to start and end python console server on demand and close it after exit, this way code is cleaner.
from aiomonitor.
Related Issues (20)
- Endless loop after exiting console HOT 12
- console command: AttributeError: '_SpecialForm' object has no attribute 'setdefault' HOT 11
- v0.4.0 doesn't work on Python 3.5 HOT 10
- Unable to start monitor with already running event loop. HOT 8
- v0.4.1 PyPI release doesn't work (PyPI package differs to Github files) HOT 5
- Traceback on process shutdown HOT 5
- Direction key seems not work in the aiomonitor console. HOT 2
- Can't use home / end / arrow keys in console HOT 3
- Add `grep`-wise option on `ps` HOT 3
- Announce: The new maintainer HOT 7
- Follow-ups to #328 HOT 3
- Update the test suite to work HOT 1
- Rewrite the docs
- [TODO] Migrate GHA workflow to use Trusted Publishing HOT 1
- Integration with OpenTelemetry, Prometheus, etc.
- Change the default port numbers to avoid the ephemeral/dynamic range
- Add the read-only mode
- Relax aiohttp dependency HOT 1
- Monitoring of multiple events in one interface HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiomonitor.