Introduction🔗

With lazy loading, code can continue before a result is available. Loading may start when the result is requested or run in the background. Background loading can reduce the wait when the result is needed.

In the context of a Pipeline, lazy loading refers to the way values are populated in an aspect data. Usually the default is to not lazily load them, so an Aspect Engine's processing does not finish until all values have been populated. When lazy loading is configured in an Aspect Engine, values begin to load in another thread, and other processing can continue.

See the Specification for more technical details.

Caveats🔗

Getting an aspect property's value from an aspect data which has been lazily loaded has the added complexity of the value not yet being known. Consequently, an exception that would otherwise have occurred during the Pipeline's processing stage has now been deferred until the point at which a value is fetched. When lazy loading is enabled, this extra possibility of an error should be taken into consideration.

Configuration🔗

Lazy loading has two main configuration options.

Property timeout🔗

As it is not known at the point of fetching an aspect property's value whether or not it has been populated, a timeout option is available. This is the time to wait for the value before throwing an exception.

Cancellation🔗

In languages where it is possible, a 'cancellation token' can be provided. This is a means of canceling all processing which is still being carried out internally to the aspect data.

Implementation🔗

Select a tab to view language specific implementation details.