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

ServiceScope fixes #1966

Merged
merged 4 commits into from
Jul 25, 2024
Merged

ServiceScope fixes #1966

merged 4 commits into from
Jul 25, 2024

Conversation

Soreepeong
Copy link
Contributor

@Soreepeong Soreepeong commented Jul 24, 2024

  • Changed IServiceScope.CreateAsync to never return null, and instead store the exception in the returned Task.
  • Changed ServiceScope to use ConcurrentDictionary<Type, Task<object>> to manage created objects.
  • Added IDalamudPluginInterface.CreateAsync to offer an alternative avoiding using .Wait. IDalamudPluginInterface.Create will work as it always did; only a small note has been added that describes what happens on failure, and its actual behavior did not change.
  • Added IDalamudPluginInterface.InjectAsync for same reasons.

@Soreepeong Soreepeong requested a review from a team as a code owner July 24, 2024 10:00
@Soreepeong
Copy link
Contributor Author

IDalamudPluginInterface.Create and .Inject should not be used if IAsyncDalamudPlugin from #1905 is to be used. .Wait() and await should not be mixed; .Wait() should not be used from anything that may be running under a Task context.

@goaaats goaaats merged commit 8c593bc into goatcorp:master Jul 25, 2024
2 of 3 checks passed
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.

2 participants