for smart only, I have this implementation to Auth...
# multiplatform
p
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
I dont use SKIE and I barely know swift. Why was I tagged on this?
p
I tought you Kevin Galligan the creator of skia sorry
p
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
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
Whoa. I can ask my team when they are back tomorrow. My guess is it's going to call the original function.
p
thank you ☺️
p
If you have a reproducing repo, that will be super helpful in guiding them to help you
🙌 1
k
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
@Tadeas Kriz thank you , does SKIE add any concurrency benefits or main thread safety ?
t
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
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
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
Thank you so much