Extend Flipper commands to support server add-on messaging
Reviewed By: mweststrate Differential Revision: D34046466 fbshipit-source-id: 9acc172c1805ec724b8709999bacf9e899c39e6b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3b390b74ff
commit
12151e4a71
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
import assert from 'assert';
|
||||
import {ClientResponseType, ExecuteMessage} from 'flipper-common';
|
||||
import {assertNotNull} from '../comms/Utilities';
|
||||
|
||||
type ServerAddOnCleanup = () => Promise<void>;
|
||||
@@ -20,9 +21,15 @@ const loadPlugin = (_pluginName: string): ServerAddOnModule => {
|
||||
return {serverAddOn: async () => async () => {}};
|
||||
};
|
||||
|
||||
interface ServerAddOnConnection {
|
||||
sendExpectResponse(payload: ExecuteMessage): Promise<ClientResponseType>;
|
||||
}
|
||||
|
||||
// TODO: Fix potential race conditions when starting/stopping concurrently
|
||||
export class ServerAddOn {
|
||||
private owners: Set<string>;
|
||||
// TODO: Implement connection
|
||||
public readonly connection!: ServerAddOnConnection;
|
||||
|
||||
constructor(
|
||||
public readonly pluginName: string,
|
||||
|
||||
Reference in New Issue
Block a user