SafeAnalysisResultAccessImpl

class SafeAnalysisResultAccessImpl @Inject constructor(val projectCache: ProjectCache) : SafeAnalysisResultAccess(source)

The only implementation of SafeAnalysisResultAccess

Constructors

Link copied to clipboard
@Inject
constructor(projectCache: ProjectCache)

Types

Link copied to clipboard

This is a hack to get around the de-duping behavior of a StateFlow. Two lists with identical contents will never be equal, so

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
private val locksCacheLock: Mutex
Link copied to clipboard
Link copied to clipboard
private val queue: MutableStateFlow<SafeAnalysisResultAccessImpl.DifferentList>

Functions

Link copied to clipboard
private suspend fun addToQueue(pendingRequest: SafeAnalysisResultAccessImpl.PendingRequest, sort: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private suspend fun <T> withLeases(pendingRequest: SafeAnalysisResultAccessImpl.PendingRequest, action: suspend () -> T): T

open suspend override fun <T> withLeases(requester: HasAnalysisResult, projectPath: ProjectPath, sourceSetName: SourceSetName, action: suspend (Collection<HasAnalysisResult>) -> T): T

Suspends until all dependency module descriptors are available for use, then acquires locks for all of them and performs action. No other project/source set will be able to read from those analysis results, binding contexts, or module descriptors until action has completed.