Plugins: let another plugin ask a plugin to act, without polling through a hook

Aperta
#687 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
22/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
laravel, php

Direzione di ricerca

Start by reading HookSender in teme/contracts to see how notify, transform and collect are offered to the declaring plugin, then read docs/guides/developers/plugins/your-own-hooks.md. Compare that with how ContentWriter is offered to plugins and how plugin register() listeners receive hooks. The issue leaves the API shape open between declared actions and a Resolve hook, so this is design work before any patch.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area/plugins type/enhancement when/later

A plugin can declare hooks of its own (Notification, Transform, Collect), but another plugin can only listen to them; nothing lets another plugin call into it. So when a scheduling plugin wants a sharing plugin to "share this item now", the sharing plugin has to declare a Collect hook and ask for requests on a timer (each minute), and the scheduling plugin has to return the same request every time until it is taken, with a key so it is planned once.

That works, but it polls for something an event would do, it delays every request by up to the poll interval, and the asking plugin can't be told the request was accepted or refused.

Expected: a way for a plugin to publish a small declared action (a name, a typed payload, a capability needed to ask) that another plugin, which requires it, may call, and which runs as the caller's person through the receiver's own checks and returns an accepted or refused answer, much as ContentWriter is offered to plugins. Or at least a hook the sender can raise for an event it wasn't listening for: the receiving plugin's register() listens, and the call returns the first listener's answer (a Resolve hook, raised by another plugin).

Where: teme/contracts (HookSender offers notify, transform and collect for the declaring plugin only), docs/guides/developers/plugins/your-own-hooks.md.

🤖 Generated with Claude Code

Lingua principale
PHP
Stelle
1
Fork
1
Merge medio
1h 40m
PR unite (30g)
143

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di temecms/teme

Tutte le issue di temecms/teme

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.