mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 01:43:15 +08:00

* [316-multi-bridge-conn] feat: use callback func for bridge response * [316-multi-bridge-conn] feat: implement multiple session support * split client handling portion into 'session' * keep track of sessions by remote address (ip & port) * notify each of the sessions anytime an event comes across the bus * [316-multi-bridge-conn] chore: move bridge files to package * [316-multi-bridge-conn] chore: remove deprecated Callback function The Callback function is no longer needed for the operation of the frontend callback since the ipc.Dispatch function now requires a callback function to be provided as an argument. This function can be a private function since it is passed by reference. * [316-multi-bridge-conn] chore: make webview.Callback private * [316-multi-bridge-conn] chore: remove unused injectCSS function I believe a slightly better method of doing this might need to be devised if it is needed in the future. I presume it should collect the values into a cache and then inject it into each sesssion as it appears. * [316-multi-bridge-conn] ensure wails:ready event is emitted Event is only emitted for the first session created from the Bridge. * [316-multi-bridge-conn] emit events for session lifecycle Emit an event for each session started and ended. * [316-multi-bridge-conn] fix: session handling fixes Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
14 lines
417 B
Go
14 lines
417 B
Go
package interfaces
|
|
|
|
// CallbackFunc defines the signature of a function required to be provided to the
|
|
// Dispatch function so that the response may be returned
|
|
type CallbackFunc func(string) error
|
|
|
|
// IPCManager is the event manager interface
|
|
type IPCManager interface {
|
|
BindRenderer(Renderer)
|
|
Dispatch(message string, f CallbackFunc)
|
|
Start(eventManager EventManager, bindingManager BindingManager)
|
|
Shutdown()
|
|
}
|