realm-swift icon indicating copy to clipboard operation
realm-swift copied to clipboard

Exception with error: "Cannot schedule async transaction. Make sure you are running from inside a run loop."

Open theoks opened this issue 3 years ago • 3 comments
trafficstars

Problem

When trying to perform an async write from within a thread without a run-loop, which is a common situation when performing an async write in a Task, an exception happens with the following error:

Cannot schedule async transaction. Make sure you are running from inside a run loop.

  1. This is missing from the documentation
  2. Is this limitation going to be lifted in the future?

Solution

No response

How important is this improvement for you?

Would be a major improvement

theoks avatar May 25 '22 14:05 theoks

Hi @theoks, Thank you for the input. I'll discuss that with the team

pavel-ship-it avatar May 27 '22 12:05 pavel-ship-it

Any news on this? This is blocking me too right now

LilaQ avatar Jul 28 '22 16:07 LilaQ

Any news?

natario1 avatar Sep 13 '22 17:09 natario1

Any update?

Dhaval3110 avatar Sep 22 '22 11:09 Dhaval3110

Hi @Dhaval3110 we are working on a better experience with async/await operations, I'll post any updates to this issue, or follow our release notes to check for changes.

dianaafanador3 avatar Sep 22 '22 11:09 dianaafanador3

@dianaafanador3 thank you for update

Dhaval3110 avatar Sep 22 '22 11:09 Dhaval3110

Any update on this please?

AdieOlami avatar Oct 27 '22 04:10 AdieOlami

🙄

nerzh avatar Dec 04 '22 10:12 nerzh

Any update?

reinosutisno avatar Dec 17 '22 14:12 reinosutisno

Any update?

Heafy avatar Jan 20 '23 15:01 Heafy

This is an ongoing project at the moment, we've been improving concurrency support in our last releases, but there some things which are still on the works. We'll let you know when this is working correctly.

dianaafanador3 avatar Jan 23 '23 09:01 dianaafanador3

Looking forward to this

samuelowino avatar Jan 26 '23 16:01 samuelowino

🙄

nerzh avatar Jan 28 '23 09:01 nerzh

any update?

EdwinXiang avatar Feb 28 '23 14:02 EdwinXiang

any update?

EdwinXiang avatar Feb 28 '23 14:02 EdwinXiang

🙄

nerzh avatar Mar 19 '23 03:03 nerzh

Current update is that we are enabling Actor confined Realm's in the near future. I know it is not exactly what is being asked for here, but technically accomplishes the same end result. Once a Realm is confined to the Actor, you will be able to do asyncWrites on it, and we/the swift concurrency runtime will handle the rest.

jsflax avatar Mar 19 '23 18:03 jsflax

Actor confined realms released here. As mentioned above, this should handle the original issue.

ejm01 avatar May 16 '23 15:05 ejm01