Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 22, 2024. It is now read-only.
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Is there any way to skip delays and execute an ongoing Job #134

Open
@vikasacharya16

Description

I have a Job like below

job = GlobalScope.launch {
 delay(5000)
 runOnUiThread {
 some unwanted code
 }
}

This job will wait for 5 seconds to execute. And to cancel it before 5 seconds I'm calling

job?.cancel()

Now, Is there a way to execute this job before 5 seconds have reached ?

I'm looking for something like job?.forceExecute.ignoreDelays or job?.forceExecute.ignoreDelay("FirstDelay") if there is a option for name like delay(5000,"FirstDelay")

That would be so helpful for me to avoid boiler plate code.

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

        AltStyle によって変換されたページ (->オリジナル) /