-
Notifications
You must be signed in to change notification settings - Fork 567
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
Druid reusability strategy #771
Comments
I would say that №1 is a necessity, and №2 is an interesting possibility. I do think it would be nice if, say, a jupyter notebook could launch some data visualization in druid, close it, and do that again. №3 feels like a mountain of heartache; each individual platform is going to be tons of stuff behind the scenes that we can't control and that is likely to cause us problems. |
Level 3 would also be a requirement for VST plugins wishing to use Druid as a GUI:
I don't want this use-case to force any architecture decisions -- if you deem it's too much work, no worries. Just throwing in a possible use-case for level 3. (Although I will add: this use case would probably have to circumvent the |
Well for one there's currently a bunch of global stuff in |
yea, I think the DAW case is just going to need to be special; we aren't creating the process at all, as far as I understand. |
I'm curious about progress on this. My use case is for item 2. I have a app running in the system tray using native_windows_gui with a open option on the right click menu. I would like selecting open to pop up my druid
|
I am trying to write some tests for druid-shell, and this is a blocker because each test runs by default in parallel in a separate thread, so all-but-one will fail on accessing I tried to work around it with Modifying With all the above though I can run multiple tests, each doing an |
Allow the `Application` to be restarted after it finished running, by ensuring it releases to false the atomic check for app initialization. On Windows platform, additionally ensure the window class is only registered once per process run, as duplicate registration will fail. This enables writing unit tests for druid-shell, which otherwise cannot be run in batch. This however still require the use of `--test-threads=1` to prevent parallel testing, which this change does not cover. Bug: linebender#771
Allow the `Application` to be restarted after it finished running, by ensuring it releases to false the atomic check for app initialization. On Windows platform, additionally ensure the window class is only registered once per process run, as duplicate registration will fail. This enables writing unit tests for druid-shell, which otherwise cannot be run in batch. This however still require the use of `--test-threads=1` to prevent parallel testing, which this change does not cover. Bug: #771
I'm also curious if there was any progress to enable this kind of behavior since it's a very common use case. I've also tried to use druid like this and i came across this exact roadblock. |
@TheKroni don't suppose you ever figure how to accomplish this? |
No, my project went in another direction. But from what I remember this feature just wasn't supported by druid back then. |
I would like to open a discussion and then settle on a strategy for druid on what sort of reusability guarantees we have. There's also a sub-question of whether this will apply to both
druid
anddruid-shell
or if those two will diverge in strategy.Here are some obvious levels of reusability:
Reuse druid in a different process.
Reuse druid in the same process sequentially, that is after one
AppLauncher::launch()
has returned the application can perform a newAppLauncher::launch()
(perhaps on the sameAppLauncher
, but requiring a new struct would be fine too) and everything would work.Reuse druid in the same process concurrently, that is several
AppLauncher::launch()
loops running at the same time in different threads.There might be other useful levels which I'm missing. Feel free to describe them.
Whichever level we choose, it should be documented so that it's clear. Assertions should be added to the code so that druid would fail with a clear error message fast, instead of eventually running into some random collision like now. All past & future code should be reviewed to ensure it works with the chosen level.
Personally I think level 1 (concurrent processes) is a must have. The other levels might require too much work for too little gain. The level 2 long running process use case could launch a sub-process when the GUI is needed, which would be fine on all non-embedded platforms I imagine.
The text was updated successfully, but these errors were encountered: