aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/command
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-04 04:07:41 +0900
committernsfisis <nsfisis@gmail.com>2026-08-04 05:43:24 +0900
commit695365a0ad68e4534425c64b7a6a4b6598b68ef7 (patch)
treea906972618f08e31012f721c717321bd08164cde /crates/shirabe/tests/command
parent261516d5ce6f8b0d69cf9e3da7dd2f0ef1cdc36a (diff)
downloadphp-shirabe-695365a0ad68e4534425c64b7a6a4b6598b68ef7.tar.gz
php-shirabe-695365a0ad68e4534425c64b7a6a4b6598b68ef7.tar.zst
php-shirabe-695365a0ad68e4534425c64b7a6a4b6598b68ef7.zip
feat(plugin): dispatch plugin event subscribers through the RPC worker
Wires the addPlugin subscriber branch end to end: EventSubscriberInterface and Capable become fallible and dyn-compatible (their sole implementor is the PHP plugin proxy, which answers getSubscribedEvents over RPC), listeners register as Callable::PhpMethod and are invoked with a per-call event handle, and the R table now drops entries when a child-side stub destructs. The R table keeps its IndexMap with monotonically increasing handles, so released handles are never reused and no generation counter is needed. Upstream has no subscriber-plugin test, so the path is covered by a Shirabe-owned fixture exercising all three getSubscribedEvents shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/command')
-rw-r--r--crates/shirabe/tests/command/archive_command_test.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/shirabe/tests/command/archive_command_test.rs b/crates/shirabe/tests/command/archive_command_test.rs
index 322894db..655020e0 100644
--- a/crates/shirabe/tests/command/archive_command_test.rs
+++ b/crates/shirabe/tests/command/archive_command_test.rs
@@ -85,6 +85,10 @@ mockall::mock! {
transaction: Transaction,
) -> anyhow::Result<i64>;
fn add_listener(&mut self, event_name: &str, listener: Callable, priority: i64);
+ fn add_subscriber<'a>(
+ &mut self,
+ subscriber: &'a dyn shirabe::event_dispatcher::EventSubscriberInterface,
+ ) -> anyhow::Result<()>;
fn has_event_listeners(&mut self, event: &dyn EventInterface) -> bool;
}
}