Skip to content

ADR: Channel size estimation is not supported#257

Merged
adamw merged 1 commit intomainfrom
adr/no-channel-size-estimation
Feb 13, 2026
Merged

ADR: Channel size estimation is not supported#257
adamw merged 1 commit intomainfrom
adr/no-channel-size-estimation

Conversation

@endrju19
Copy link
Contributor

@endrju19 endrju19 commented Feb 13, 2026

Summary

  • Adds ADR documenting the decision to not expose Channel.estimateSize() or any size estimation on channels
  • The lock-free segment-based algorithm tracks send/receive attempts (not completions), so interrupted operations permanently inflate any naive senders - receivers estimate
  • Kotlin's kotlinx.coroutines (same algorithm) deliberately omits any size method for the same reason
  • Users who need channel-level metrics should build external solutions (e.g., wrapping send/receive with their own counters)

Resolves #189. Supersedes #254.

@endrju19 endrju19 requested a review from adamw February 13, 2026 10:24
@adamw adamw merged commit e720a10 into main Feb 13, 2026
8 checks passed
@adamw adamw deleted the adr/no-channel-size-estimation branch February 13, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Channel.estimateSize() ?

2 participants