Skip to content

Commit

Permalink
fix(embedded): apply style lint fixes.
Browse files Browse the repository at this point in the history
Signed-off-by: Dario Valdespino <dvaldespino00@gmail.com>
  • Loading branch information
darvld authored and sgammon committed May 7, 2024
1 parent e8afca8 commit bda525d
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public fun interface EmbeddedCallDispatcher {
* progress.
*/
public fun dispatch(call: EmbeddedCall, app: EmbeddedApp): Deferred<EmbeddedResponse>
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public data class EmbeddedConfiguration(
* languages are supported during initialization, and must verify applications at the time of registration.
*/
val guestLanguages: Set<EmbeddedGuestLanguage>,
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ public enum class EmbeddedProtocolFormat {

/** Selects Cap'n'Proto as the binary exchange format for the invocation protocol. */
CAPNPROTO,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ package elide.embedded
public enum class EmbeddedProtocolVersion {
/** Selects version 1.0 of the dispatch protocol. */
V1_0,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public interface EmbeddedRuntimeContext {

/** The embedded call codec used by the runtime. */
public val codec: EmbeddedCallCodec
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ internal sealed interface AppEntrypoint
return FetchEntrypoint(module.getMember("fetch"))
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,10 @@ internal class EmbeddedAppImpl private constructor(
* thrown. Exceptions will be rethrown after causing the handle to fail.
*/
private inline fun withHandle(handle: CompletableJob, block: () -> Unit) {
try {
block()
handle.complete()
} catch (cause: Throwable) {
handle.completeExceptionally(cause)
throw cause
}
runCatching(block)
.onSuccess { handle.complete() }
.onFailure { handle.completeExceptionally(it) }
.getOrThrow()
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ import elide.embedded.http.EmbeddedRequest
internal data class EmbeddedCallImpl(
override val id: EmbeddedCallId,
override val request: EmbeddedRequest,
) : EmbeddedCall
) : EmbeddedCall
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ internal class MicronautRuntimeContext private constructor(
return MicronautRuntimeContext(config, appContext)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ class EmbeddedAppTest {
app.start().join()
assertEquals(EmbeddedAppState.RUNNING, app.state.value, "expected app to move into 'running' state after restart")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ class EmbeddedRuntimeTest {

logging.info("Response: $result")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,4 @@ class NativeEmbeddedRuntimeTest {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ internal class NativeCallbackAdapter private constructor(private val call: (Int)
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ context(Arena) suspend fun assertNativeSuccessSuspending(message: String? = null
actual = result.await(),
message = "Expected deferred operation to complete successfully${if (message != null) ": $message" else ""}",
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ internal abstract class NativeLibrary {
linker.downcallHandle(address, descriptor)
}.orElse(null) ?: error("Failed to load native function '$name'")
}
}
}

0 comments on commit bda525d

Please sign in to comment.