Skip to content

refactor(core): simplify listen() API by internalizing Io setup - #1

Merged
codev911 merged 1 commit into
mainfrom
refactor/simplify-listen-api
May 18, 2026
Merged

refactor(core): simplify listen() API by internalizing Io setup#1
codev911 merged 1 commit into
mainfrom
refactor/simplify-listen-api

Conversation

@codev911

Copy link
Copy Markdown
Member

Summary

  • Move std.Io.Threaded initialization from every call site into listener.listenAndServe(), eliminating the need for users to manually create and pass an
    io instance
  • Simplify App.listen() signature from listen(self, io, address) to listen(self, address)
  • Update all 9 examples + README to reflect the cleaner API

Changed files

  • src/core/listener.ziglistenAndServe() now creates its own std.Io.Threaded internally
  • src/core/app.ziglisten() no longer accepts io parameter
  • examples/*.zig (8 files) — remove manual threaded/io boilerplate
  • README.md — update quickstart snippet

Move `std.Io.Threaded` initialization from every call site into
`listener.listenAndServe()` so users no longer need to manually create
and pass an `io` instance. This reduces boilerplate in all examples and
public API surface.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codev911
codev911 requested a review from a team May 17, 2026 23:57
@codev911 codev911 self-assigned this May 17, 2026
@codev911 codev911 added the enhancement New feature or request label May 17, 2026
@codev911
codev911 merged commit 9dabb82 into main May 18, 2026
16 checks passed
@codev911
codev911 deleted the refactor/simplify-listen-api branch May 18, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant