ipc

package
v2.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

GO render IPC通道

Index

Constants

View Source
const (
	InternalIPCGoExecuteGoEvent       = "GoEmitGo"
	InternalIPCGoExecuteJSEventReplay = "GoEmitGoReplay"
)

Variables

This section is empty.

Functions

func CheckEmitCallback

func CheckEmitCallback(id int32) *callback.Callback

CheckEmitCallback

IPC checks if the GO Emit callback function exists
returns the function and removes it

func CheckOnEvent

func CheckOnEvent(name string) *callback.Callback

CheckOnEvent

IPC checks if the event listening in GO exists
returns the function and removes it

func Emit

func Emit(name string, argument ...interface{}) bool

Emit

Event that triggers listening
default to triggering the main process

func EmitAndCallback

func EmitAndCallback(name string, argument []interface{}, fn interface{}) bool

EmitAndCallback

Event that triggers listening
with callback function
default to the main process

func EmitTarget

func EmitTarget(name string, tag target.ITarget, argument ...interface{}) bool

EmitTarget

Trigger an event for the specified target to listen to

func EmitTargetAndCallback

func EmitTargetAndCallback(name string, tag target.ITarget, argument []interface{}, fn interface{}) bool

EmitTargetAndCallback

Trigger an event with a callback function for the specified target to listen on

func On

func On(name string, fn interface{}, options ...types.OnOptions)

On

IPC GO Listening for events

func RemoveOn

func RemoveOn(name string)

RemoveOn IPC GO Remove listening events

func SetBrowserWindow added in v2.3.6

func SetBrowserWindow(bw target.IBrowserWindow)

SetBrowserWindow Set BrowserWindow on initialization

func SetProcessMessage

func SetProcessMessage(pm target.IWindow)

SetProcessMessage

Set the process message object
without manually calling it

Types

type EmitContextCallback

type EmitContextCallback func(context context.IContext)

EmitContextCallback IPC context Callback Function

type IBrowserIPCChan

type IBrowserIPCChan interface {
	IPC() channel.IBrowserChannel
	AddCallback(callback func(channelId int64, argument argument.IList) bool)
}

func BrowserChan

func BrowserChan() IBrowserIPCChan

BrowserChan

返回Browser IPC Channel, 这个是在channel创建的

func CreateBrowserIPC

func CreateBrowserIPC() IBrowserIPCChan

CreateBrowserIPC

Main process IPC creation

type IRenderIPCChan

type IRenderIPCChan interface {
	IPC() channel.IRenderChannel
	SetRealityChannel(browserId int32, channelId int64)
	AddCallback(callback func(channelId int64, argumentList argument.IList) bool)
	BrowserId() int32
	ChannelId() int64
}

func CreateRenderIPC

func CreateRenderIPC(browserId int32, channelId int64) IRenderIPCChan

CreateRenderIPC Rendering process IPC creation

func RenderChan

func RenderChan() IRenderIPCChan

type WaitChan added in v2.4.0

type WaitChan struct {
	Pending *sync.Map
	// contains filtered or unexported fields
}

WaitChan

IPC synchronous receiving data channel

func (*WaitChan) Done added in v2.4.0

func (m *WaitChan) Done(messageId int32, data interface{})

func (*WaitChan) NewDelayer added in v2.4.0

func (m *WaitChan) NewDelayer(messageId int32, delay time.Duration) *delayer

NewDelayer 创建一个计时器

func (*WaitChan) NextMessageId added in v2.4.0

func (m *WaitChan) NextMessageId() (id int32)

NextMessageId 返回下一个消息ID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL