ConcurrentCreationException class

Exception thrown when multiple threads or async operations try to create the same instance simultaneously.

This exception is thrown in the following scenarios:

  • When multiple async operations try to create the same instance at the same time
  • When there's a race condition during instance creation
  • When the same factory is accessed concurrently before the first creation completes
  • When using async factories with concurrent access patterns

Common causes:

  • Multiple parts of the code trying to get the same instance simultaneously
  • Async factories being accessed before their creation process completes
  • Circular dependencies that cause concurrent creation attempts

To resolve this issue:

  • Ensure that instance creation is properly awaited
  • Use ddi.isReady<Type>() to check if an instance is already created
  • Avoid concurrent access to the same factory during creation
  • Use proper async/await patterns when dealing with async factories
Implemented types

Constructors

ConcurrentCreationException(String cause)
const

Properties

cause String
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited