question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There is a confusion between kotlinx.coroutines.experimental.run and kotlin.run functions from stdlib. We should rename the former. A better name is TBD.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
fvascocommented, Sep 29, 2017

withContext(coroutineContext) looks clear.

withoutCancellation doesn’t seem much clear.

1reaction
mtopolnikcommented, Feb 8, 2018

As a user of withContext in an Android project I can add my experience. In a specific example, I have this line:

val nextFrame = withContext(threadPool) { gifDecoder.nextFrame }

(threadPool is a global val in my project, my own threadpool-context)

The name withContext is unevocative. It doesn’t convey the magic of what it will do; more importantly, it doesn’t even signal that it’s about coroutines. The suggestion runIn would solve a lot of issues I have with the current name, even though it may have some other problems.

Why do async and await work well? Simply because people got used to them in other languages and now they are a part of the vernacular. In this light, maybe Kotlin should try to introduce another simple keyword to capture its “sequential by default” policy. One idea that came to mind is is to lean on the paradigm of threads/fibers and see this as “weaving” or “stitching together” different threads in the sequential execution of a single coroutine: execution jumps to the other one and then resumes on the current one.

As a designer of public API myself I’m kind of sorry to have to bring this up, I share your pain 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rename a run - SPARKvue Help - PASCO scientific
Click Choose Run To Rename, then select the run you want to rename. Click the Edit Run Name field and type a new...
Read more >
Rename runs - PASCO Capstone Help
Double-click the run, sensor, or measurement name you want to rename. Type a new name for the run, then press Enter on your...
Read more >
Rename Runs dialog box - ADM Help Centers
This dialog box enables you to rename run names to enable easy identification when measuring the transaction response time.
Read more >
docker rename - Docker Documentation
Description. The docker rename command renames a container. For example uses of this command, refer to the examples section below.
Read more >
rename | Dart Package - Pub.dev
Helps you to change or rename your flutter project BundleId and AppName for Ios, Android, ... networkUpp pub global run rename --appname "Network...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found