79302065

Date: 2024-12-23 03:33:14
Score: 0.5
Natty:
Report link

I guess you’re talking about handling concurrency in Riverpod. Unlike Flutter BLoC, which is event-based and processes events one at a time, Riverpod doesn’t handle concurrency for you.

If you call two async notifier methods at the same time, there’s a chance they could overwrite each other’s changes, which is something to watch out for.

To deal with this in Riverpod, you’d need to handle it manually using something like a Mutex or a custom queue to ensure updates happen one at a time.

There was actually an issue raised in the Riverpod GitHub where it was clarified that concurrency needs to be managed manually,

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Narendra Bhatt