withContext
Executes block with ctx merged into the current context, then restores the previous context regardless of whether block throws.
The merged context is formed by overlaying ctx on top of the current context - keys present in ctx override existing keys, while keys not present in ctx are preserved from the outer context.
Return
The value returned by block.
Parameters
The context to merge into the current context for the duration of block.
The block of code to execute within the merged context.
Executes block with ctx merged into the current context, then restores the previous context regardless of whether block throws.
The merged context is formed by overlaying ctx on top of the current context - keys present in ctx override existing keys, while keys not present in ctx are preserved from the outer context.
Return
The value returned by block.
Parameters
The context to merge into the current context for the duration of block.
The block of code to execute within the merged context.
Executes block with ctx merged into the current context, then restores the previous context regardless of whether block throws.
The merged context is formed by overlaying ctx on top of the current context - keys present in ctx override existing keys, while keys not present in ctx are preserved from the outer context.
Return
The value returned by block.
Parameters
The context to merge into the current context for the duration of block.
The block of code to execute within the merged context.
Executes block with ctx merged into the current context, then restores the previous context regardless of whether block throws.
The merged context is formed by overlaying ctx on top of the current context - keys present in ctx override existing keys, while keys not present in ctx are preserved from the outer context.
Return
The value returned by block.
Parameters
The context to merge into the current context for the duration of block.
The block of code to execute within the merged context.
Executes block with ctx merged into the current context, then restores the previous context regardless of whether block throws.
The merged context is formed by overlaying ctx on top of the current context - keys present in ctx override existing keys, while keys not present in ctx are preserved from the outer context.
Return
The value returned by block.
Parameters
The context to merge into the current context for the duration of block.
The block of code to execute within the merged context.
Executes block with ctx merged into the current context, then restores the previous context regardless of whether block throws.
The merged context is formed by overlaying ctx on top of the current context - keys present in ctx override existing keys, while keys not present in ctx are preserved from the outer context.
Return
The value returned by block.
Parameters
The context to merge into the current context for the duration of block.
The block of code to execute within the merged context.
Executes block with ctx merged into the current context, then restores the previous context regardless of whether block throws.
The merged context is formed by overlaying ctx on top of the current context - keys present in ctx override existing keys, while keys not present in ctx are preserved from the outer context.
Return
The value returned by block.
Parameters
The context to merge into the current context for the duration of block.
The block of code to execute within the merged context.
Executes block with ctx merged into the current context, then restores the previous context regardless of whether block throws.
The merged context is formed by overlaying ctx on top of the current context - keys present in ctx override existing keys, while keys not present in ctx are preserved from the outer context.
Return
The value returned by block.
Parameters
The context to merge into the current context for the duration of block.
The block of code to execute within the merged context.