Skip to content

Split callback watching into focused units - #22

Merged
tehwave merged 1 commit into
mainfrom
claude/callback-watch-runner-refactor
Nov 23, 2026
Merged

tehwave merged 1 commit into
mainfrom
claude/callback-watch-runner-refactor

Conversation

@tehwave

@tehwave tehwave commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Splits CallbackWatchRunner, which ran both single-payment and account-wide watching in one 373-line class, into focused units. Behaviour and output are unchanged.

Changed

  • SinglePaymentWatch and AccountWideWatch each run one watch mode; WatchPoller, OperationForwarder and WatchedPayment hold the polling, delivery and payment logic both modes share. CallbackWatchRunner only picks the mode.
  • CallbackWatcher::run() takes a CallbackWatchRequest value object instead of eight parameters.
  • Progress events are methods on a typed CallbackWatchObserver instead of strings with loose arrays. CallbackWatchProgress renders them for callbacks:watch, so an event can no longer be misspelled or missed.

Testing

composer check passes: the Pest suite, PHPStan and Pint.

🤖 Generated with Claude Code

CallbackWatchRunner ran both watch modes and owned polling, delivery and
payment parsing. It now only picks the mode:

- SinglePaymentWatch: one payment by payment ID or order ID
- AccountWideWatch: every payment from the readiness second
- WatchPoller: shared retrying poll (non-retryable errors still stop)
- OperationForwarder: shared signing and FIFO delivery with retries
- WatchedPayment: payment ID and operation parsing
- CallbackWatchRequest: replaces run()'s eight parameters
- CallbackWatchObserver: one typed method per progress event, replacing
  string event names and loose context arrays
- CallbackWatchProgress: renders those events for callbacks:watch

Messages, retry rules, exit behaviour and the sleep/continue/clock hooks
are unchanged; tests change only where they called the old signatures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tehwave
tehwave merged commit 5b7cfa0 into main Nov 23, 2026
7 checks passed
@tehwave
tehwave deleted the claude/callback-watch-runner-refactor branch November 23, 2026 19:26
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