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

Kotlinify MessageQueueThreadPerfStats, ReactQueueConfiguration and QueueThreadExceptionHandler #49215

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Migrate MessageQueueThreadPerfStats, ReactQueueConfiguration and Queu…
…eThreadExceptionHandler to Kotlin
  • Loading branch information
mateoguzmana committed Feb 5, 2025
commit 10f5573e7e542fd726426bce6061a94fa7e04c48
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.bridge.queue;
package com.facebook.react.bridge.queue

/** This class holds perf counters' values at the beginning of an RN startup. */
public class MessageQueueThreadPerfStats {
public long wallTime;
public long cpuTime;
public var wallTime: Long = 0
public var cpuTime: Long = 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.bridge.queue;
package com.facebook.react.bridge.queue

/**
* Interface for a class that knows how to handle an Exception thrown while executing a Runnable
* submitted via {@link MessageQueueThread#runOnQueue}.
* submitted via [MessageQueueThread.runOnQueue].
*/
public interface QueueThreadExceptionHandler {

void handleException(Exception e);
public fun interface QueueThreadExceptionHandler {
public fun handleException(e: Exception)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.bridge.queue;
package com.facebook.react.bridge.queue

/**
* Specifies which {@link MessageQueueThread}s must be used to run the various contexts of execution
* Specifies which [MessageQueueThread]s must be used to run the various contexts of execution
* within catalyst (Main UI thread, native modules, and JS). Some of these queues *may* be the same
* but should be coded against as if they are different.
*
* <p>UI Queue Thread: The standard Android main UI thread and Looper. Not configurable. Native
*
* UI Queue Thread: The standard Android main UI thread and Looper. Not configurable. Native
* Modules Queue Thread: The thread and Looper that native modules are invoked on. JS Queue Thread:
* The thread and Looper that JS is executed on.
*/
public interface ReactQueueConfiguration {
MessageQueueThread getUIQueueThread();
public fun getUIQueueThread(): MessageQueueThread

MessageQueueThread getNativeModulesQueueThread();
public fun getNativeModulesQueueThread(): MessageQueueThread

MessageQueueThread getJSQueueThread();
public fun getJSQueueThread(): MessageQueueThread

void destroy();
public fun destroy()
}
Loading