• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

phly / phly-swoole-taskworker / 22 / 2
98%
master: 98%

Build:
Build:
LAST BUILD BRANCH: 2.0.0
DEFAULT BRANCH: master
Ran 10 Mar 2020 08:09PM UTC
Files 12
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Mar 2020 08:05PM UTC coverage: 97.917% (+0.8%) from 97.101%
COMPOSER_ARGS="--no-interaction" COVERAGE_DEPS="php-coveralls/php-coveralls" DEPS=locked CS_CHECK=true TEST_COVERAGE=true

Pull #4

travis-ci

web-flow
feat: service-based deferred listeners

In playing some more with Swoole task workers, I discovered that any
listeners you provide MUST be serializable - which poses a problem for
listeners that compose things such as HTTP clients, database adapters,
etc.

This patch:

- Adds a `Psr\Container\ContainerInterface $container` argument to
  `TaskInterface::__invoke()`.
- Modifies `TaskWorker` to compose the PSR-11 container, and pass it to
  tasks as it invokes them.
- Adds `ServiceBasedTask`, which accepts a service name and payload
  arguments to its constructor. When invoked, it will pull the service
  from the container. If the service is a `DeferredServiceListener`, it
  will pull the listener from that instance and use that. It invokes the
  service.
- Adds `DeferredServiceListener`, which creates a ServiceBasedTask with
  the service name passed to its constructor, and defines a
  `getListener()` method for getting the actual listener to use when
  handling the task.
- Adds `DeferredServiceListenerDelegator`, which creates a
  `DeferredServiceListener` using the service name and the result of
  calling the delegator's factory argument.

What this means is that users can assign the
`DeferredServiceListenerDelegator` as a delegator factory on listeners
that should defer execution to the Swoole task workers. This will be
safer than the `DeferredListenerDelegator` in almost every case.
Pull Request #4: feat: service-based deferred listeners

94 of 96 relevant lines covered (97.92%)

1.95 hits per line

Source Files on job 22.2 (COMPOSER_ARGS="--no-interaction" COVERAGE_DEPS="php-coveralls/php-coveralls" DEPS=locked CS_CHECK=true TEST_COVERAGE=true)
  • Tree
  • List 0
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 15
  • Travis Job 22.2
  • 7022c54b on github
  • Prev Job for DEPS=locked CS_CHECK=true TEST_COVERAGE=true on feature/fix-closure-tasks (#19.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc