https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
p

pers

02/24/2024, 12:47 PM
for smart only, I have this implementation to AuthenticationPort
Copy code
class AuthenticationAdapter: AuthenticationPort {
func __signIn(parameterName: String) async throws -> Result2<Auth0User, shared.AuthenticationError> {
    do {
      let credentials = try await Auth0.webAuth()
        .connection(parameterName)
        .scope("openid profile email offline_access read:current_user update:current_user_metadata")
        .audience("https://" + clientInfo.domain + "/api/v2/")
        .start()
}

....
}
Is there any benefits of using SKIE like concurrency , and do we need to ask Task {} the function call from kotlin @kevin.cianfarini @russhwolf
k

kevin.cianfarini

02/24/2024, 12:53 PM
I dont use SKIE and I barely know swift. Why was I tagged on this?
p

pers

02/24/2024, 12:57 PM
I tought you Kevin Galligan the creator of skia sorry
p

Pamela Hill

02/25/2024, 12:49 PM
Hi, @kpgalligan is the real Kevin Galligan 😉
🙌 1
SKIE will help with cancellation, yes you will need Task AFAIK for calling a suspend function. I'm not familiar with AuthenticationPort, where are you getting the code?
p

pers

02/25/2024, 12:53 PM
thank you , just asking about 1. overriding suspend fun in swift 2. call overridden function from kotlin how kotlin is going to handle this
p

Pamela Hill

02/25/2024, 12:56 PM
Whoa. I can ask my team when they are back tomorrow. My guess is it's going to call the original function.
p

pers

02/25/2024, 12:56 PM
thank you ☺️
p

Pamela Hill

02/25/2024, 12:57 PM
If you have a reproducing repo, that will be super helpful in guiding them to help you
🙌 1
k

kpgalligan

02/26/2024, 3:57 PM
1. overriding suspend fun in swift
2. call overridden function from kotlin
This is a @Tadeas Kriz question for sure. Suspend functions in SKIE are different than the default ones that the Kotlin compiler produces, and I don't know how overriding them in Swift would be handed in the SKIE context.
thank you color 2
p

pers

02/26/2024, 7:22 PM
@Tadeas Kriz thank you , does SKIE add any concurrency benefits or main thread safety ?
t

Tadeas Kriz

02/26/2024, 7:24 PM
SKIE adds support for calling Kotlin
suspend
functions from any Swift thread, so you no longer need
@MainActor
for those call and can call Kotlin
suspend
functions like any other Swift
async
functions. I'm not sure what you mean by "main thread safety"?
🙌 1
p

pers

02/26/2024, 7:53 PM
is there ant workaround rather than "This limitation can be solved without SKIE by passing a special configuration flag to the compiler" to remove @MainActor
t

Tadeas Kriz

02/26/2024, 7:56 PM
Removing
@MainActor
might not be what you want. It depends on the semantics of your Swift code. If you decide you don't need
@MainActor
, you can either pass in the flag to the compiler, or use SKIE. SKIE also give you cancelation support when calling Kotlin
suspend
from Swift.
🙌 1
p

pers

02/26/2024, 7:58 PM
Thank you so much
5 Views