Skip to content

Dispatch log batches off the main thread#266

Closed
MaxHeimbrock wants to merge 1 commit intomainfrom
max/logs-off-main-thread
Closed

Dispatch log batches off the main thread#266
MaxHeimbrock wants to merge 1 commit intomainfrom
max/logs-off-main-thread

Conversation

@MaxHeimbrock
Copy link
Copy Markdown
Contributor

Logs from Rust were going through SynchronizationContext.Post like every other event, which is wasteful: UnityEngine.Debug.unityLogger is thread-safe, log batches are SDK-internal (no user callback expectation), and in LK_VERBOSE builds they can flood the post queue.

Forward them inline from the FFI callback alongside AudioStreamEvent and remove the now-unreachable Logs case from DispatchEvent.

Logs from Rust were going through SynchronizationContext.Post like every
other event, which is wasteful: UnityEngine.Debug.unityLogger is
thread-safe, log batches are SDK-internal (no user callback expectation),
and in LK_VERBOSE builds they can flood the post queue.

Forward them inline from the FFI callback alongside AudioStreamEvent and
remove the now-unreachable Logs case from DispatchEvent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MaxHeimbrock
Copy link
Copy Markdown
Contributor Author

Done in:
#269

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