Skip to content

Commit

Permalink
docs: use KDoc syntax for kotlin (#193)
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Schore <mike.schore@gmail.com>
Signed-off-by: JP Simard <jp@jpsim.com>
  • Loading branch information
goaway authored and jpsim committed Nov 28, 2022
1 parent 58f08a4 commit 1a917ae
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions mobile/library/kotlin/io/envoyproxy/envoymobile/Envoy.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package io.envoyproxy.envoymobile
import android.content.Context
import io.envoyproxy.envoymobile.engine.EnvoyEngine

// Wrapper class that allows for easy calling of Envoy's JNI interface in native Java.
/**
* Wrapper class that allows for easy calling of Envoy's JNI interface in native Java.
*/
class Envoy @JvmOverloads constructor(
context: Context,
config: String,
Expand All @@ -13,10 +15,12 @@ class Envoy @JvmOverloads constructor(
// Dedicated thread for running this instance of Envoy.
private val runner: Thread

// Create a new Envoy instance. The Envoy runner Thread is started as part of instance
// initialization with the configuration provided. If the Envoy native library and its
// dependencies haven't been loaded and initialized yet, this will happen lazily when
// the first instance is created.
/**
* Create a new Envoy instance. The Envoy runner Thread is started as part of instance
* initialization with the configuration provided. If the Envoy native library and its
* dependencies haven't been loaded and initialized yet, this will happen lazily when
* the first instance is created.
*/
init {
// Lazily initialize Envoy and its dependencies, if necessary.
load(context)
Expand All @@ -28,13 +32,17 @@ class Envoy @JvmOverloads constructor(
runner.start()
}

// Returns whether the Envoy instance is currently active and running.
/**
* Returns whether the Envoy instance is currently active and running.
*/
fun isRunning(): Boolean {
val state = runner.state
return state != Thread.State.NEW && state != Thread.State.TERMINATED
}

// Returns whether the Envoy instance is terminated.
/**
* Returns whether the Envoy instance is terminated.
*/
fun isTerminated(): Boolean {
return runner.state == Thread.State.TERMINATED
}
Expand Down

0 comments on commit 1a917ae

Please sign in to comment.