From 695365a0ad68e4534425c64b7a6a4b6598b68ef7 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 4 Aug 2026 04:07:41 +0900 Subject: 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 --- crates/shirabe/tests/installer_test.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/shirabe/tests/installer_test.rs') diff --git a/crates/shirabe/tests/installer_test.rs b/crates/shirabe/tests/installer_test.rs index d0b60ba8..1a8b7ccc 100644 --- a/crates/shirabe/tests/installer_test.rs +++ b/crates/shirabe/tests/installer_test.rs @@ -188,6 +188,12 @@ impl EventDispatcherInterface for StubEventDispatcher { Ok(0) } fn add_listener(&mut self, _event_name: &str, _listener: Callable, _priority: i64) {} + fn add_subscriber( + &mut self, + _subscriber: &dyn shirabe::event_dispatcher::EventSubscriberInterface, + ) -> anyhow::Result<()> { + Ok(()) + } fn has_event_listeners(&mut self, _event: &dyn EventInterface) -> bool { false } -- cgit v1.3.1