Skip to content
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

Bug: AppExecutorUtil.getAppScheduledExecutorService().scheduleWithFixedDelay #149

Open
cmp-nct opened this issue Oct 19, 2022 · 4 comments

Comments

@cmp-nct
Copy link

cmp-nct commented Oct 19, 2022

The timer stays loaded in the context of the LivePlugin.
Even when you reload (or stop) the plugin, it will still continue in the background.

If you start it several times you'll have mulitple of those timers running on the old code.

@dkandalov
Copy link
Owner

dkandalov commented Oct 19, 2022 via email

@cmp-nct
Copy link
Author

cmp-nct commented Oct 19, 2022

Thanks for the update, I tried and didn't work for me. Though I'm not a java developer ;)
It would be nice if there was a liveplugin callback that can be registered which is called on load, reload and on unload.

@dkandalov
Copy link
Owner

dkandalov commented Oct 19, 2022

This is not specific to Java.

It might be useful to add to LivePlugin a wrapper API for AppExecutorUtil which will require pluginDisposable and will cancel scheduled tasks on plugin reload. There're many other areas in IJ or Java API which don't use Disposables though so it's hard to draw a line 🤔

@cmp-nct
Copy link
Author

cmp-nct commented Oct 20, 2022

Imho it doesn't fit to the idea of "unloading" a plugin that it keeps 'lost' background tasks in the IDE context.
I understand it's normal behavior and not a bug, I'd still try to prevent it from happening.
A wrapper that handles it on LivePlugin's side would be probably the best.

Your LivePlugin is the only thing I found that actually is well working, comes with samples and is not a total pain to implement.
I was one step from giving up when I wrote 2 days ago, today my plugin is working :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants