Skip to content

StdEngine (net/http compatibility wrapper) #10

Description

@FumingPower3925

Summary

Compatibility engine wrapping Go's net/http with H2C support. Works on all platforms (macOS, Windows, Linux). Implements the Engine interface.

Deliverables

  • StdEngine struct implementing Engine interface
  • Wrap net/http.Server with h2c.NewHandler for H2C support
  • Bridge between *celeris.Context and http.ResponseWriter/*http.Request
  • Same application code works across all engines (io_uring, epoll, std)
  • Graceful shutdown via server.Shutdown(ctx)

Design

// StdEngine wraps net/http for cross-platform compatibility
type StdEngine struct {
    server *http.Server
    // ...
}
  • H2C enabled via golang.org/x/net/http2/h2c package
  • Context bridging: convert between Celeris zero-copy context and stdlib request/response
  • Metrics collection: request count, latency, connections via ConnState hook

Tests

  • Full integration on macOS (primary dev platform)
  • Full integration on Linux (CI)
  • HTTP/1.1 request/response
  • H2C request/response (via h2c.NewHandler)
  • Same handler code works on StdEngine and native engines
  • Graceful shutdown (in-flight requests complete)
  • Metrics collection accuracy

SDD Reference

Sections 2.3, 11.4

Dependencies

Depends on #2, #3, #4, #6

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions