
Maybe with a combination of:
- https://www.drupal.org/project/consumers
- sending consumers the channels concerned by the CRUD operation
- on the client site having a list of channels subscribed
- or sending only the CRUDed entity.
Comment | File | Size | Author |
---|---|---|---|
#11 | interdiff_5_11.txt | 7.42 KB | steven jones |
#11 | entity_share-automatic_synchronization-WIP-3080629-11.patch | 32.01 KB | steven jones |
#5 | entity_share-automatic_synchronization-WIP-3080629-5.patch | 33.39 KB | grimreaper |
Comments
Comment #2
fathershawnPerhaps! - My client wants the update to happen via automation, not just to be notified, however. I will checkout Consumers though to see if it helps with implementation. This line interests me though:
At the start our system will have a small number of sites, but if it scales, I either have to throttle the pings from server to client that trigger a pull or change to push to prevent what someone else named a "thundering herd" of requests from client to server.
Comment #3
grimreaperComment #5
grimreaperAnd here is a patch for this feature...
Exhausting.
Finally I didn't use the consumers module and I had chosen to rely on the existing entity_share_async sub-module.
What does the patch do?
So:
This is a WIP patch for the following reasons:
I am also feeling that entity share is reaching slowly a point of unmaintainability with all those services cross dependent. #3060694: Rework service and tests is becoming critical.
Thanks for the review and feedbacks!
Comment #6
mrpauldriver CreditAttribution: mrpauldriver commentedI am very new to entity_share, so please excuse me if I am missing something obvious.
The subscriber form requires a Remote ID
How to determine the ID to use?
Comment #7
grimreaperHello,
The remote ID is the machine name of the remote website config entity on your client website.
Comment #8
mrpauldriver CreditAttribution: mrpauldriver commentedThanks. Is there an easy way discovering this, rather diving into yml files?
Comment #9
grimreaperI don't know your setup, but if you don't have access to the client website BO, yes, only looking at yml files is the solution.
This question is out of the scope of the issue queue.
Comment #10
grimreaperComment #11
steven jones CreditAttribution: steven jones as a volunteer commentedHere's an updated patch that takes the excellent work in #5 and extends it to add in the new import config stuff, and also allows it to work with entities where language translation is not available.
Comment #12
grimreaperHello @Steven Jones,
Thanks a lot for the updated patch! This will greatly help when going back on this issue.
Currently not the priority, so not reviewing/testing.
Regards,
Comment #13
grimreaperHello,
Changing the status into "Postponed", waiting for https://www.drupal.org/project/entity_share_websub to have a release to test.
Comment #14
grimreaperComment #15
grimreaperI have compared again patch from this issue then Entity Share Websub and I think the only point preventing me from marking this issue as won't fix/works as designed is that Entity Share Websub is missing #3192103: Channel subscription.
Otherwise I think Entity Share Websub has a better handling of this use case.
Comment #16
grimreaperIf this is an auth method like in the remote config entity, this shouls use the same mecanism now that authentication is pluggable.
Filter the channels based on the langcode, entity type and bundle before loading the channels if possible to avoid loading hundreds of entities depending on the websites.
Or this will require to have an array of channel_id, user_id in the subscriber config entity instead of an array of channel IDS.
Possible to add a condition on the channels based on $channels_to_notify? To avoid loading unnecessary entities.
Should we require that a subscriber should reference a remote to benefit from the authentication system? And so we can use the remote manager service to get the HTTP client.
Comment #17
beerendlauwers CreditAttribution: beerendlauwers at Netvlies commentedEDIT: I noticed you were talking about another part of the code. This part goes inside the
channels
loop.I wrote some code a long while ago for the channel filtering. This goes before
$channels_to_notify[] = $channel->id();
.It's pretty rough, of course. Ideally, the operators would plug in to an
entityQuery
, but I'm not sure if the semantics of JSON:API andentityQuery
coincide. Alternatively, we could have a plugin for each filter operator and write the needed logic there.Comment #18
beerendlauwers CreditAttribution: beerendlauwers at Netvlies commentedFor number 5, we could load it from the
remote_id
:This could also be done in the constructor if you feel that's cleaner.