Skip to content

Commit 109d78a

Browse files
authored
docs: deduplicate callKey KDoc across the context promotion chain (#126)
PR: #126
1 parent 53b850c commit 109d78a

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

sdk-core/src/main/kotlin/org/dexpace/sdk/core/http/context/ExchangeContext.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ import org.dexpace.sdk.core.instrumentation.InstrumentationContext
1919
*
2020
* As the terminal link this is the context whose [close] should be called to evict the
2121
* chain's [ContextStore] entry. In the normal flow the [callKey] is supplied by
22-
* [RequestContext.toExchangeContext]. When this context is constructed directly off-chain, the
23-
* [callKey] defaults to a freshly minted, call-unique key (`traceId:spanId:n`) — the same
24-
* collision-safe derivation [DispatchContext] uses — so two directly-constructed contexts that
25-
* share a trace/span id never collide in [ContextStore]. Two such default-constructed instances
26-
* are therefore not structurally equal; pin an explicit [callKey] if you need equality.
22+
* [RequestContext.toExchangeContext]. When this context is constructed directly off-chain it
23+
* defaults to a freshly minted, call-unique key (`traceId:spanId:n`) via
24+
* [DispatchContext.mintCallKey] — see [DispatchContext] for why the trace/span pair alone is not
25+
* a collision-safe store key. One consequence of the minted default: two default-constructed
26+
* instances are not structurally equal, since each mints a distinct key — pin an explicit
27+
* [callKey] if you need equality.
2728
*/
2829
public data class ExchangeContext(
2930
override val instrumentationContext: InstrumentationContext,

sdk-core/src/main/kotlin/org/dexpace/sdk/core/http/context/RequestContext.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ import org.dexpace.sdk.core.instrumentation.InstrumentationContext
1818
* [DispatchContext] it was promoted from.
1919
*
2020
* In the normal flow the [callKey] is supplied by [DispatchContext.toRequestContext] so the
21-
* whole chain shares one store slot. When this context is constructed directly off-chain, the
22-
* [callKey] defaults to a freshly minted, call-unique key (`traceId:spanId:n`) — the same
23-
* collision-safe derivation [DispatchContext] uses — so two directly-constructed contexts that
24-
* share a trace/span id never collide in [ContextStore]. Two such default-constructed instances
25-
* are therefore not structurally equal; pin an explicit [callKey] if you need equality.
21+
* whole chain shares one store slot. When this context is constructed directly off-chain it
22+
* defaults to a freshly minted, call-unique key (`traceId:spanId:n`) via
23+
* [DispatchContext.mintCallKey] — see [DispatchContext] for why the trace/span pair alone is not
24+
* a collision-safe store key. One consequence of the minted default: two default-constructed
25+
* instances are not structurally equal, since each mints a distinct key — pin an explicit
26+
* [callKey] if you need equality.
2627
*/
2728
public data class RequestContext(
2829
override val instrumentationContext: InstrumentationContext,

0 commit comments

Comments
 (0)