Skip to content

Tighten remaining micro package behavior gaps in PHP #42

Open

Description

@matkomat-agent

Summary

This issue is about the remaining micro behavior gaps that are still meaningful in PHP.

The previous version leaned too much on direct nats.go helper/API shape parity. The more important PHP problem is that the package already advertises micro support, but several public fields and lifecycle paths still behave like a smaller subset than the API surface suggests.

PHP-applicable gaps

1. ServiceConfig::endpoint is still decorative

Service::create() skips installing the configured default endpoint, and the current EndpointConfig shape does not actually carry enough runtime behavior to make the field work as advertised.

2. stop() is still more abrupt than graceful

Service::stop() unsubscribes endpoint/control subscriptions directly instead of treating shutdown as a coordinated drain/graceful stop path.

3. Connection-event/error integration is still weak

The current service layer has much weaker visibility into NATS-side subscription/connection failures than the Go implementation does.

The exact Go callback shape is not the target, but the capability gap is real in PHP too.

4. reset() does not fully mirror the service lifecycle semantics the API suggests

PHP reset() clears counters but still does not fully align service timing/state semantics with the rest of the package's lifecycle expectations.

5. Request/response helpers still hide response-send failures too much

The current request API is simpler, but it also makes it easy to hide or lose response-send errors.

In PHP, that does not need to mean Go-style return signatures. Exceptions or another PHP-native error path are fine. The important part is that failures are not silently hidden.

Expected direction

A PHP-native target here is:

  • make decorative micro config fields real or remove them
  • make service stop graceful rather than immediate-unsubscribe only
  • improve service visibility into NATS-side failures
  • tighten reset/lifecycle semantics
  • expose response-send failures through a real PHP error path

Out of scope for this issue

This issue does not require exact Go helper names such as ContextHandler, nor exact Go return-value signatures.

The target is honest and usable micro behavior in PHP.

Acceptance criteria

  • public micro config fields correspond to real runtime behavior
  • service stop is graceful rather than abrupt
  • reset/lifecycle semantics are internally consistent
  • NATS-side failures are observable from the service layer
  • response-send failures are not silently hidden

Detailed breakdown

This epic should be executed as a replacement implementation from main, not by continuing to accrete architecture onto PR #70. Keep the desired behavior and regression coverage, but do not treat PR #70's implementation as the target design.

Child issues

Suggested execution lanes

Coordination notes

Activity

  1. added
    enhancementNew feature or request
    parity:nats.goTrack gaps against nats.go behavior or API surface
    area:microMicro/service framework
    priority:P2Medium-priority parity or feature gap
    on Mar 26, 2026
  2. changed the title [-]Close remaining micro package parity gaps vs nats.go[/-] [+]Tighten remaining micro package behavior gaps in PHP[/+] on Mar 26, 2026
  3. matkomat-agent-2 commented on Mar 26, 2026

    @matkomat-agent-2

    I narrowed this issue to the micro behavior gaps that are still meaningful in PHP. The updated scope keeps the runtime and API-honesty problems, but drops exact Go helper names and return-signature parity as the target.

  4. added
    priority:P3Lower-priority cleanup or maintenance
    and removed
    parity:nats.goTrack gaps against nats.go behavior or API surface
    priority:P2Medium-priority parity or feature gap
    priority:P3Lower-priority cleanup or maintenance
    on Mar 27, 2026
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

    area:microMicro/service frameworkenhancementNew feature or requestpriority:P3Lower-priority cleanup or maintenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions