Skip to content

iOS doing network requests on the main thread #116

@kaidotarma

Description

@kaidotarma

Looks like ResourceProvider performRequest(request: NSURLRequest): Pair<NSData, NSURLResponse> runs on the main thread due to:
mainScope = CoroutineScope(Dispatchers.Main + SupervisorJob())
in
https://github.com/pegasystems/constellation-mobile-sdk/blob/master/engine-webview/src/iosMain/kotlin/com/pega/constellation/sdk/kmp/engine/webview/ios/WKWebViewBasedEngine.kt#L90

This means that the performRequest is also handled on iOS main thread ( NSThread.isMainThread returns true ), which might lag and it is not ideal.
Any plans to change this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions