Migrate Continuation to kotlin (#47537)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47537

Migrate Continuation interface to kotlin

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D65738326

fbshipit-source-id: 1a119f6d349101951dc528583f3dbaf5441da91e
This commit is contained in:
David Vacca 2024-11-11 07:03:00 -08:00 committed by Facebook GitHub Bot
parent 17b69795c3
commit b8337ebf97

View File

@ -5,20 +5,16 @@
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.runtime.internal.bolts;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
package com.facebook.react.runtime.internal.bolts
/**
* A function to be called after a task completes.
*
* <p>If you wish to have the Task from a Continuation that does not return a Task be cancelled then
* throw a {@link java.util.concurrent.CancellationException} from the Continuation.
* throw a [java.util.concurrent.CancellationException] from the Continuation.
*
* @see Task
*/
public interface Continuation<TTaskResult, TContinuationResult> {
@Nullable
TContinuationResult then(@NonNull Task<TTaskResult> task) throws Exception;
@Throws(Exception::class) public fun then(task: Task<TTaskResult>): TContinuationResult?
}