pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

First pass at an `atom.signal` API (inter-window communcation)

Open savetheclocktower opened this issue 2 years ago • 1 comments

Fixes #822.

Description of the Change

Implements a simplified API for one window to send a signal to all windows, optionally including itself. (#822 explores scenarios where this could be needed.) We use the main process to act as a broker.

Alternate Designs

I started out envisioning that this would combine reactivity and storage, much like atom.config. But we can already use localStorage for the storage side, and I didn’t feel like reimplementing the whole thing when what’s most urgently needed is the signaling.

Possible Drawbacks

I can’t really think of any. This is a pretty thin layer over Electron’s built-in tools for communicating between the main process and the individual renderer processes.

Verification Process

None yet! This PR is in draft mode while I figure out exactly how I’m gonna test this thing.

Release Notes

  • Added atom.signal, an API for sending messages between different Pulsar windows.

savetheclocktower avatar Dec 06 '23 07:12 savetheclocktower

Updated this just now with a proof-of-concept in pulsar-updater to make sure it works.

This will stay in draft until I write some tests, but I wanted to update it while it was fresh on my mind.

savetheclocktower avatar Jan 13 '24 02:01 savetheclocktower