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

Reduce GlobalScope usage #461

Open
skalarproduktraum opened this issue Dec 16, 2021 · 5 comments
Open

Reduce GlobalScope usage #461

skalarproduktraum opened this issue Dec 16, 2021 · 5 comments
Labels
bugfixathon-2021 Issues that are up for grabs for the 2021 scenery & sciview bugfixathon

Comments

@skalarproduktraum
Copy link
Member

For concurrency, scenery uses GlobalScope is a few places, which is discouraged now.
A better solution for this needs to be found. Maybe @elect86 or @altavir have suggestions 😎

@elect86
Copy link
Member

elect86 commented Dec 16, 2021

I wish I could help with coroutines, but I still haven't used them enough to be familiar with :/

@skalarproduktraum skalarproduktraum added the bugfixathon-2021 Issues that are up for grabs for the 2021 scenery & sciview bugfixathon label Dec 16, 2021
@altavir
Copy link

altavir commented Dec 16, 2021

The GlobalScope is indeed a bad practice. The good practice is to create a scope for your application and pass it explicitly where you need it. Could you give links to places in question, or we can plan an online session to discuss that.

@skalarproduktraum
Copy link
Member Author

skalarproduktraum commented Dec 16, 2021

How about this one? The intention there is to invoke a lambda asynchronously when a new Node is added.

Edit: Pasted wrong URL first. D'oh.

@altavir
Copy link

altavir commented Dec 16, 2021

I don't understand what this line does. Looks like it just assigned a field to itself.

@altavir
Copy link

altavir commented Dec 16, 2021

You probably wanted to link to something like


And it is indeed not good. If the process is long, the structured concurrency is broken here. You need to provide a scope for such operations. Pass it as a parameter or store it in the Node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfixathon-2021 Issues that are up for grabs for the 2021 scenery & sciview bugfixathon
Projects
None yet
Development

No branches or pull requests

3 participants