# Coroutine friendly version of AnAction

**URL:** <https://platform.jetbrains.com/t/coroutine-friendly-version-of-anaction/5009>\
**Category:** IntelliJ Platform\
**Tags:** remote-development, plugin-development\
**Created:** [September 6, 2026, 2:32am UTC](https://platform.jetbrains.com/t/coroutine-friendly-version-of-anaction/5009 "2026-09-06T02:32:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.sciachero](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/m.sciachero/32/245_2.png) [@m.sciachero](https://platform.jetbrains.com/u/m.sciachero)\
**Post date:** [September 6, 2026, 2:32am UTC](https://platform.jetbrains.com/t/coroutine-friendly-version-of-anaction/5009/1 "2026-09-06T02:32:44Z")

</div>

Hi all,  
will be possible to have a coroutine friendly version of `AnAction`?

The idea is to have at least `update` and `actionPerformed` as suspend function, with split mode could be that the update or actionPerformed rely on information that are on remote side and having it natively suspend function will help a lot.

Thanks a lot in advance.

Regards,  
Mirko

---

<div class="post-metadata">

**Author:** ![yuriy.artamonov](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/yuriy.artamonov/32/48_2.png) [@yuriy.artamonov](https://platform.jetbrains.com/u/yuriy.artamonov)\
**Post date:** [September 6, 2026, 7:32am UTC](https://platform.jetbrains.com/t/coroutine-friendly-version-of-anaction/5009/2 "2026-09-06T07:32:11Z")

</div>

Hi, please use the following pattern to launch suspend activities from `actionPerformed`:

```kotlin
class DemoAction: AnAction() {
  override fun actionPerformed(e: AnActionEvent) {
    e.coroutineScope.launch { 
      
    }

```

Not possible for update yet, unfortunately. There you had better create cache of data for actions and populate it asynchronously.

---

<div class="post-metadata">

**Author:** ![m.sciachero](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/m.sciachero/32/245_2.png) [@m.sciachero](https://platform.jetbrains.com/u/m.sciachero)\
**Post date:** [September 6, 2026, 7:47am UTC](https://platform.jetbrains.com/t/coroutine-friendly-version-of-anaction/5009/3 "2026-09-06T07:47:22Z")

</div>

Just in case, which are the advantages of using this pattern?

---

<div class="post-metadata">

**Author:** ![yuriy.artamonov](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/yuriy.artamonov/32/48_2.png) [@yuriy.artamonov](https://platform.jetbrains.com/u/yuriy.artamonov)\
**Post date:** [September 6, 2026, 8:08am UTC](https://platform.jetbrains.com/t/coroutine-friendly-version-of-anaction/5009/4 "2026-09-06T08:08:35Z")

</div>

It is a suspend activity originated from action, no need to create an additional service, `coroutineScope` it attached to project and plugin lifecycle, so cancellation works properly in case of dispose/close of project
