landelare / ue5coro

A C++20 coroutine plugin offering seamless integration with Unreal Engine 5.
BSD 3-Clause Clear License
617 stars 57 forks source link

Stop or cancel coroutine #5

Closed Instand closed 1 year ago

Instand commented 1 year ago

Hello, sorry for my question. I use your UE5Coro to learn Coroutines and UE5. I need to stop or cancel running/suspended coroutine. Is there any possibility to do that under FAsyncCoroutine? Big thanks in advance.

landelare commented 1 year ago

There's currently no explicit support for this, but the good news is that you don't need any!


Built-in support for this is a highly-requested feature that's relatively high on my list of things to implement. I want to do something more convenient than simply reinventing CancellationTokens, which is basically the shared bool pointer approach with lipstick on. Unified support for BP latent actions and "true" async makes this difficult from both an implementation complexity and a runtime performance standpoint, which is mainly why this hasn't shipped yet. I don't want to commit to a subpar implementation.

Instand commented 1 year ago

Thank you for answer. The second solution is not what i need really. I want something like this FAsyncCoroutine::Cancel(). Okay, i will try to think how implement it better for my approach and needs. Big thanks for your time, hope you will find a better solution =)

landelare commented 1 year ago

This feature will ship in 1.8.