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

Main thread data #245

Merged
merged 20 commits into from
Jul 8, 2021
Merged

Main thread data #245

merged 20 commits into from
Jul 8, 2021

Conversation

semuserable
Copy link
Contributor

@semuserable semuserable commented Jun 30, 2021

MVP

Idea is the following: create singleton root game object from SentryUnityOptions (doesn't matter how many times you call new()), assign needed MonoBehaviours on it and return them immediately. Access MonoBehaviour and pass needed data downstream.

Additionally, we can cache whatever data we want to acquire on the main thread and reuse it later (ex. UnityEventProcessor). In the initial commit, I made an example for SystemInfo.operatingSystem (which should be called on the main thread only).

The current PR is related to #238, #233

src/Sentry.Unity/MainThreadBevahiour.cs Outdated Show resolved Hide resolved
src/Sentry.Unity/SentryUnityOptions.cs Outdated Show resolved Hide resolved
@semuserable semuserable marked this pull request as ready for review July 6, 2021 15:08
Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I have just nit picks.

@bitsandfoxes thoughts?

src/Sentry.Unity/SentryMonoBehaviour.cs Outdated Show resolved Hide resolved
src/Sentry.Unity/SentryMonoBehaviour.cs Outdated Show resolved Hide resolved
src/Sentry.Unity/SentryMonoBehaviour.cs Outdated Show resolved Hide resolved
src/Sentry.Unity/SentryMonoBehaviour.cs Outdated Show resolved Hide resolved
src/Sentry.Unity/SentryMonoBehaviour.cs Outdated Show resolved Hide resolved
src/Sentry.Unity/SentryMonoBehaviour.cs Outdated Show resolved Hide resolved
src/Sentry.Unity/UnityEventProcessor.cs Show resolved Hide resolved
@bruno-garcia bruno-garcia merged commit 7a93853 into main Jul 8, 2021
@bruno-garcia bruno-garcia deleted the feature/main-thread-data branch July 8, 2021 15:27
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.

3 participants