@tokamakdev/platform-android-arm64 0.1.1-beta.50 → 0.1.1-beta.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -38,8 +38,8 @@ class TokamakApplication : Application(), TokamakHost {
|
|
|
38
38
|
requireNotNull(metadata()?.getString(HOST_METADATA)) { "$HOST_METADATA is required" }
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
override fun
|
|
42
|
-
runtime.
|
|
41
|
+
override fun call(name: String, body: String, timeoutMillis: Long): String =
|
|
42
|
+
runtime.call(name, body, timeoutMillis)
|
|
43
43
|
|
|
44
44
|
override fun plugin(id: String): TokamakPlugin? = plugins[id]
|
|
45
45
|
|
|
@@ -15,12 +15,11 @@ internal class TokamakRuntime private constructor(private val handle: Long) {
|
|
|
15
15
|
fun resume() = nativeResume(handle)
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* [timeoutMillis] passes
|
|
20
|
-
* no such handler.
|
|
18
|
+
* Posts the JSON [body] to the Worker's `/tokamak/<name>` endpoint, blocking until it
|
|
19
|
+
* responds 200 or [timeoutMillis] passes, and returns the response body.
|
|
21
20
|
*/
|
|
22
|
-
fun
|
|
23
|
-
|
|
21
|
+
fun call(name: String, body: String, timeoutMillis: Long): String =
|
|
22
|
+
nativeCall(handle, name, body, timeoutMillis)
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* The authority a server certificate for [host] must chain to, or null
|
|
@@ -77,12 +76,12 @@ internal class TokamakRuntime private constructor(private val handle: Long) {
|
|
|
77
76
|
private external fun nativeResume(handle: Long)
|
|
78
77
|
|
|
79
78
|
@JvmStatic
|
|
80
|
-
private external fun
|
|
79
|
+
private external fun nativeCall(
|
|
81
80
|
handle: Long,
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
name: String,
|
|
82
|
+
body: String,
|
|
84
83
|
timeoutMillis: Long,
|
|
85
|
-
): String
|
|
84
|
+
): String
|
|
86
85
|
|
|
87
86
|
@JvmStatic
|
|
88
87
|
private external fun nativeServerAuthority(handle: Long, host: String): ByteArray?
|
|
@@ -52,12 +52,11 @@ interface TokamakHost {
|
|
|
52
52
|
val activity: Activity?
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* off the main thread; throws when the handler fails or runs longer than [timeoutMillis].
|
|
55
|
+
* Posts the JSON [body] to the Worker's `/tokamak/<name>` endpoint and returns the
|
|
56
|
+
* response body. Starts the runtime when it is not running. Blocks, so call it off the main
|
|
57
|
+
* thread; throws unless the Worker responds 200 within [timeoutMillis].
|
|
59
58
|
*/
|
|
60
|
-
fun
|
|
59
|
+
fun call(name: String, body: String, timeoutMillis: Long): String
|
|
61
60
|
|
|
62
61
|
/** The plugin with [id], or null when the app does not include it. */
|
|
63
62
|
fun plugin(id: String): TokamakPlugin?
|