Skip to content

refactor(session): drop openStreamWith prepare callback#35

Merged
floatdrop merged 1 commit into
draft-18from
refactor/simplify-open-alloc-request
Jun 29, 2026
Merged

refactor(session): drop openStreamWith prepare callback#35
floatdrop merged 1 commit into
draft-18from
refactor/simplify-open-alloc-request

Conversation

@floatdrop

Copy link
Copy Markdown
Owner

Summary

openStreamWith existed only to slot Request-ID allocation between OpenStream and Marshal via a parameterless prepare func() hook. With exactly two callers — OpenRequest (no prepare) and openAllocRequest (prepare = allocate ID) — the callback was pure indirection.

This removes openStreamWith:

  • OpenRequest and openAllocRequest each open the stream directly.
  • openAllocRequest allocates the Request ID as a plain statement after a successful open (preserving the §10.1 guarantee that a failed open consumes no ID).
  • The marshal-and-reset-on-failure tail is shared via a small writeFirst helper.

No behavior change; pure readability cleanup.

Test plan

  • go build ./...
  • go test ./pkg/moqt/session/
  • golangci-lint run pkg/moqt/session/

🤖 Generated with Claude Code

openStreamWith existed only to slot Request-ID allocation between
OpenStream and Marshal via a parameterless prepare func() hook. With
just two callers (OpenRequest, openAllocRequest), the callback was pure
indirection. Inline the open in each opener, allocate the ID as a plain
statement after a successful open, and share the marshal/reset tail via
writeFirst.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@floatdrop floatdrop merged commit 91278a6 into draft-18 Jun 29, 2026
9 checks passed
@floatdrop floatdrop deleted the refactor/simplify-open-alloc-request branch June 29, 2026 12:31
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.

1 participant