2017 © Pedro Peláez
 

library nymph-pubsub

A library for publishing/subscribing to Nymph database changes.

image

sciactive/nymph-pubsub

A library for publishing/subscribing to Nymph database changes.

  • Friday, May 4, 2018
  • by hperrin
  • Repository
  • 3 Watchers
  • 0 Stars
  • 252 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 20 Versions
  • 3 % Grown

The README.md

Nymph PubSub Server - collaborative app data

Latest Stable Version Open Issues License, (*1)

Powerful object data storage and querying for collaborative web apps., (*2)

Deprecation Notice

The PHP implementation of Nymph/Tilmeld has been deprecated. It will no longer have any new features added. Instead, a new version of Nymph running on Node.js, written entirely in TypeScript will replace the PHP implementation. You can find it over at the Nymph.js repo., (*3)

Installation

Automatic Setup

The fastest way to start building a Nymph app is with the Nymph App Template., (*4)

Manual Installation

composer require sciactive/nymph-pubsub

This repository is the PHP publish/subscribe server. For more information, you can see the main Nymph repository., (*5)

Usage

// pubsub.php: Start with `php pubsub.php [-d]`

if (php_sapi_name() != "cli") {
  die("You can only run pubsub.php from the command line.");
}

// This is an example server that is configured with hostname
// "pubsubnetwork1entry" as an entry point to network1, which contains two
// endpoint servers, "pubsubnetwork1endpoint1" and "pubsubnetwork1endpoint2".

// Setting a default timezome is highly recommended.
date_default_timezone_set('America/Los_Angeles');

require 'vendor/autoload.php';

// Set up Nymph.
use Nymph\Nymph;
Nymph::configure([
  'MySQL' => [
    'host' => 'your_db_host',
    'database' => 'your_database',
    'user' => 'your_user',
    'password' => 'your_password'
  ]
]);

\Nymph\Nymph::connect();

// Allow this file to be called with "-d" to daemonize it.
if (in_array('-d', $argv)) {
  function shutdown() {
    posix_kill(posix_getpid(), SIGHUP);
  }

  // Switch over to daemon mode.
  if ($pid = pcntl_fork()) {
    return;
  }

  register_shutdown_function('shutdown');
} else {
  error_reporting(E_ALL);
}

// Set up Nymph PubSub.
$config = include(__DIR__.'/pubsub-config.php');
$config['port'] = 8080;
$config['relays'] = [
  'ws://pubsubnetwork1endpoint1:8080/',
  'ws://pubsubnetwork1endpoint2:8080/'
];
$server = new \Nymph\PubSub\Server($config);

// Run the server.
$server->run();
// pubsub-config.php

// This config file tells Nymph to publish entity updates to these network entry
// points. They will then relay the publish to their network.

return [
  'entries' => [
    'ws://pubsubnetwork1entry:8080/',
    'ws://pubsubnetwork2entry:8080/',
    'ws://pubsubnetwork3entry:8080/'
  ]
];
// somewhere in your Nymph rest endpoint.
$config = include('path/to/pubsub/pubsub-config.php');
\Nymph\PubSub\Server::configure($config);

For a thorough step by step guide to setting up Nymph on your own server, visit the Setup Guide., (*6)

API Docs

Check out the API Docs in the wiki., (*7)

The Versions

04/05 2018

dev-master

9999999-dev http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0 LGPL

The Requires

 

The Development Requires

subscribe publish pubsub web sockets nymph

04/05 2018

3.0.0-beta.4

3.0.0.0-beta4 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

subscribe publish pubsub web sockets nymph

23/04 2018

3.0.0-beta.3

3.0.0.0-beta3 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

subscribe publish pubsub web sockets nymph

17/11 2017

3.0.0-beta.2

3.0.0.0-beta2 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0

The Requires

 

subscribe publish pubsub web sockets nymph

16/11 2017

3.0.0-beta.1

3.0.0.0-beta1 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0

The Requires

 

subscribe publish pubsub web sockets nymph

31/10 2017

2.2.1

2.2.1.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0

The Requires

 

subscribe publish pubsub web sockets nymph

25/10 2017

2.2.0

2.2.0.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0

The Requires

 

subscribe publish pubsub web sockets nymph

21/07 2017

1.6.0

1.6.0.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0

The Requires

 

subscribe publish pubsub web sockets nymph

18/06 2017

1.5.5

1.5.5.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0

The Requires

 

subscribe publish pubsub web sockets nymph

16/06 2017

dev-cleanup

dev-cleanup http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

LGPL

The Requires

 

subscribe publish pubsub web sockets nymph

16/06 2017

1.5.0

1.5.0.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

LGPL

The Requires

 

subscribe publish pubsub web sockets nymph

16/06 2017

1.5.1

1.5.1.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0

The Requires

 

subscribe publish pubsub web sockets nymph

16/06 2017

1.5.2

1.5.2.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

Apache-2.0

The Requires

 

subscribe publish pubsub web sockets nymph

02/09 2015

1.4.3

1.4.3.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

LGPL

The Requires

 

subscribe publish pubsub web sockets nymph

17/04 2015

1.4.2

1.4.2.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

LGPL

The Requires

 

subscribe publish pubsub web sockets nymph

16/04 2015

1.4.1

1.4.1.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

LGPL

The Requires

 

subscribe publish pubsub web sockets nymph

27/03 2015

1.4.0

1.4.0.0 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

LGPL

The Requires

 

subscribe publish pubsub web sockets nymph

18/02 2015

1.4.0-beta.2

1.4.0.0-beta2 http://nymph.io/

A library for publishing/subscribing to Nymph database changes.

  Sources   Download

LGPL

The Requires

 

web sockets

18/02 2015
18/02 2015