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

Thread autoload bootstrap #110

Open
wants to merge 17 commits into
base: fork
Choose a base branch
from
Open

Thread autoload bootstrap #110

wants to merge 17 commits into from

Conversation

dktapps
Copy link
Member

@dktapps dktapps commented Apr 24, 2023

This is a duplicate of #23, which was closed by the deletion of the fork-ng branch and can't be reopened due to github.

Upon further musings, I think it would make sense to allow adding multiple files for this. In essence, this function allows the developer to say "require this file before running any thread code". Perhaps addAutoloadFile() instead of setAutoloadFile().

@dktapps
Copy link
Member Author

dktapps commented Nov 21, 2023

In conjunction with Thread::getSharedGlobals(), this could become a powerful tool for thread bootstrapping

@dktapps
Copy link
Member Author

dktapps commented Nov 21, 2024

Some new ideas:

  • Allow providing parameters to the bootstrap script. This would be useful to make selected ThreadSafe objects automatically available to all threads (e.g. by putting them in static properties). This would probably be nicer than Thread::getSharedGlobals().
  • Allow providing a Runnable instead of a file. File doesn't really make any sense and isn't consistent with anything else in the system.
  • Allow providing multiple bootstraps (the current code only allows 1).

With the idea having occurred to me that bootstrap files could accept arguments, Thread::getSharedGlobals() suddenly makes a lot less sense...

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

Successfully merging this pull request may close these issues.

1 participant