The current pull architecture could be enhanced to provide continuous delivery of updated content on change at the source using a flow inspired by the flow in the W3C WebSub recommended protocol. The attached flow diagram departs from the standard in that the content distribution notifications in this proposal are processed by the client (subscriber) and trigger a pull from the server (publisher) rather than delivering either the full content or a diff as standard either expresses or implies. In this proposal, the entity_share_client acts as the protocol subscriber and the entity_share_server acts as publisher and hub. The protocol's topic could be a channel but for our purposes I think it would be better for each entity to be a topic.

The flow in the attached diagram is as follows:

  1. Client discovers Hub url advertised by the Server
  2. Client sends a POST request to Hub url at Server to subscribe to updates about a topic.
  3. Server verifies subscription with a GET request back to the Client
  4. On content change, the Server makes a POST request to each Client with notification of the change
  5. The Client processes the notification, triggering a sync for that entity using the current process

Foundational classes for this approach are found in core dependencies:

  • \Zend\Feed\PubSubHubbub\Publisher
  • \Zend\Feed\PubSubHubbub\Subscriber

We would need to extend these and create or find a Hub implementation.

CommentFileSizeAuthor
continuous_websub_inspired.png257.69 KBFatherShawn
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

FatherShawn created an issue. See original summary.

Grimreaper’s picture

Hello,

Thanks again for the suggestion. Please see my comment #2856715-20: Push form.

This feature is interesting, but it should be optional, and also seeing all the other features requests and tasks, I will not have the time to push that forward.

If you want, you can make a patch to make some POC and still continue to discuss about that.

FatherShawn’s picture

Definitely optional @Grimreaper! I'm picturing two optional modules, one to work with server and one with the client. Perhaps we should add the to the ecosystem as additional contrib? Or would you picture expanding the optional sub-modules?

Grimreaper’s picture

Other Drupal project or sub-modules?

Hum... As you want! I don't have any preference. For entity_share_async, I had chosen sub-module because it was developed by Smile so easier to handle project permission and update.

If you want, you can create a dedicated Drupal project, as entity_share_cron, so you will have the possibility to commit directly. And maybe adding me as a co-maintainer. 100% as you want!

:)

Grimreaper’s picture

Hi @FatherShawn,

I have shared some though about another approach in the issue #3080629: Automatic notification of update changes.

Maybe it can be easier to implement.

Grimreaper’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Grimreaper’s picture

I think this issue will be marked as fixed once https://www.drupal.org/project/entity_share_websub will be available ;)

Or it can already be marked as fixed. As you want :)

Grimreaper’s picture

Related issues: +#2856715: Push form

Relating to the issue #2856715: Push form to easily found discussions in this issue.

Grimreaper’s picture

Hello,

Now that there is code in https://www.drupal.org/project/entity_share_websub, can we mark this issue has fixed?

FatherShawn’s picture

Status: Active » Fixed

Happy to clean up your issue queue!

Grimreaper’s picture

Thanks for the reply :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.