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

[Draft] [Android] Add BackgroundExecutor #205

Closed
wants to merge 1 commit into from

Conversation

FranAguilera
Copy link
Contributor

Explorations for not blocking caller thread doing initial setup of sdk via Capture.Logger.start()

Will link doc with more context soon

Force init on background thread
@FranAguilera FranAguilera requested a review from murki February 3, 2025 15:33
@FranAguilera FranAguilera marked this pull request as draft February 3, 2025 15:33
/**
* A single threaded [ExecutorService] that can be used to run an specific block of code
*/
object BackgroundExecutor {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the idea of having executors definition on a separate place, I think this could be a good opportunity to organize them all, maybe something similar to what I was playing with here https://github.com/bitdriftlabs/capture-sdk/pull/128/files#diff-118bdebccae8c1bde50314ef9d78f897d272e1f222d57a5d8a44d4f0f348b5d4R13

Copy link
Contributor

Choose a reason for hiding this comment

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

another example https://github.com/measure-sh/measure/blob/0721674bbba592e32b3b66d2e5a390e6c594cf89/android/measure/src/main/java/sh/measure/android/executors/ExecutorServiceRegistry.kt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

totally agree, will update

Copy link
Contributor

Choose a reason for hiding this comment

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

i'm not sure if making them lazy would yield any significant improvements for start, but worth trying as well

@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants