RPC support#1464
Draft
valzargaming wants to merge 1 commit intomasterfrom
Draft
Conversation
Member
Author
|
This is an early-stage proof of concept and shouldn’t be merged. I can't meaningfully test this in its current state as I do not have readily available access to my only bot that uses oauth2. I'm leaving this PR here as a draft to invite a discussion on what such an implementation could or should look like, with the expectation that a future implementation should be developed in a separate repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces cross-platform support for connecting to Discord's IPC (Inter-Process Communication) using ReactPHP, with special handling for Windows named pipes. It adds a new example demonstrating asynchronous IPC usage, and introduces a flexible connector factory and a Windows-specific connector placeholder that guides users on enabling Windows support.
New Example and Platform Connector Abstraction:
examples/rpc_ipc.php) that demonstrates connecting to Discord IPC using ReactPHP, handling events, and managing responses with timeouts.ConnectorFactoryto abstract platform-specific connector creation, returning aReact\Socket\Connectoron Unix-like systems and aWindowsPipeConnectorornullon Windows depending on support.Windows Named-Pipe Support and Guidance:
WindowsPipeConnector, a placeholder connector that provides actionable error messages if async named-pipe support is not yet available. It supports connecting via a TCP proxy (DISCORD_IPC_TCP_PROXY) or spawning a helper process (DISCORD_IPC_PROXY) to bridge named pipes, and otherwise clearly instructs users how to enable support.