PHPackages                             robier/php-pubsub-http - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. robier/php-pubsub-http

ActiveLibrary[HTTP &amp; Networking](/categories/http)

robier/php-pubsub-http
======================

An HTTP adapter for the php-pubsub package

1.0.0(9y ago)0106MITPHPPHP &gt;=5.6.0

Since May 24Pushed 3y agoCompare

[ Source](https://github.com/robier/php-pubsub-http)[ Packagist](https://packagist.org/packages/robier/php-pubsub-http)[ RSS](/packages/robier-php-pubsub-http/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (5)Used By (0)

php-pubsub-http
===============

[](#php-pubsub-http)

An HTTP adapter for the [php-pubsub](https://github.com/Superbalist/php-pubsub) package.

[![Author](https://camo.githubusercontent.com/abd4e3e2e71081ad01ef09a60c49d70c5e0677497f38918e740703cd02605078/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d40737570657262616c6973742d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/superbalist)[![Build Status](https://camo.githubusercontent.com/d6e396742bc7cc4487d4969a838aec9cd5920d3f03baf56d16cb49fb7e48d320/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f537570657262616c6973742f7068702d7075627375622d687474702f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Superbalist/php-pubsub-http)[![StyleCI](https://camo.githubusercontent.com/8de63cc885d232e87ddba0fef7bf80048b993bd96570ded41155c95714555665/68747470733a2f2f7374796c6563692e696f2f7265706f732f36373333343433302f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/67334430)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/678a643f30337cd366c0d1574c267a702b44fb9db327bb0a053c6027dc469e97/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737570657262616c6973742f7068702d7075627375622d687474702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/superbalist/php-pubsub-http)[![Total Downloads](https://camo.githubusercontent.com/970ea2805a0742917e730cadc26f319bf17d24becf88d80edf7710498b72e7f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737570657262616c6973742f7068702d7075627375622d687474702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/superbalist/php-pubsub-http)

This adapter assumes that you have a HTTP service which accepts an array of messages POSTed to a /messages/(channel) end-point.

A server-side implementation, [js-pubsub-rest-proxy](https://github.com/Superbalist/js-pubsub-rest-proxy), is available as a plug and play Docker appliance.

Installation
------------

[](#installation)

```
composer require superbalist/php-pubsub-http
```

Usage
-----

[](#usage)

```
putenv('GOOGLE_APPLICATION_CREDENTIALS=' . __DIR__ . '/../your-gcloud-key.json');

// create the underlying adapter which is going to be decorated
$pubSubClient = new \Google\Cloud\PubSub\PubSubClient([
    'projectId' => 'your-project-id-here',
]);

$subscribeAdapter = new \Superbalist\PubSub\GoogleCloud\GoogleCloudPubSubAdapter($pubSubClient);

// now create our decorator
// the decorator will proxy subscribe calls straight to the $subscribeAdapter
// publish calls will be POSTed to the service uri
$client = new \GuzzleHttp\Client();

$adapter = new \Superbalist\PubSub\HTTP\HTTPPubSubAdapter($client, 'https://127.0.0.1', $subscribeAdapter);

// consume messages
$adapter->subscribe('my_channel', function ($message) {
    var_dump($message);
});

// publish messages
$adapter->publish('my_channel', 'HELLO WORLD');
$adapter->publish('my_channel', ['hello' => 'world']);

// publish multiple messages
$messages = [
    'Hello World!',
    ['hello' => 'world'],
];
$adapter->publishBatch('my_channel', $messages);
```

Examples
--------

[](#examples)

The library comes with [examples](examples) for the adapter and a [Dockerfile](Dockerfile) for running the example scripts.

Run `make up`.

You will start at a `bash` prompt in the `/opt/php-pubsub` directory.

If you need another shell to publish a message to a blocking consumer, you can run `docker-compose run php-pubsub-http /bin/bash`

To run the examples:

```
$ ./run_consumer.sh
$ ./run_publisher.sh (in a separate shell)
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1003 days

Total

3

Last Release

1320d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3607521?v=4)[Robert](/maintainers/robier)[@robier](https://github.com/robier)

---

Top Contributors

[![matthewgoslett](https://avatars.githubusercontent.com/u/1571743?v=4)](https://github.com/matthewgoslett "matthewgoslett (4 commits)")[![shad0wfir3](https://avatars.githubusercontent.com/u/20926935?v=4)](https://github.com/shad0wfir3 "shad0wfir3 (3 commits)")[![robier](https://avatars.githubusercontent.com/u/3607521?v=4)](https://github.com/robier "robier (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/robier-php-pubsub-http/health.svg)

```
[![Health](https://phpackages.com/badges/robier-php-pubsub-http/health.svg)](https://phpackages.com/packages/robier-php-pubsub-http)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[spatie/crawler

Crawl all internal links found on a website

2.8k18.5M66](/packages/spatie-crawler)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M46](/packages/tencentcloud-tencentcloud-sdk-php)[guzzlehttp/guzzle-services

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.

25711.0M191](/packages/guzzlehttp-guzzle-services)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
