mergeWith

Merges this context with another, with the other context's values taking precedence. Does not modify either original context.

Note: This is intentionally not an operator function to avoid conflict with CoroutineContext.plus which is inherited via CoroutineContext.Element.

Example:

val base = FlippingExecutionContext(ContextKeys.ENVIRONMENT to "prod", ContextKeys.REGION to "US")
val override = FlippingExecutionContext(ContextKeys.REGION to "EU")
val merged = base.mergeWith(override)
// merged has env=prod, region=EU

Return

A new FlippingExecutionContext with merged parameters

Parameters

other

The context to merge with