Skip to content

v0.9.0

Compare
Choose a tag to compare
@esiqveland esiqveland released this 11 Feb 22:41
· 44 commits to master since this release
76c80de

Fixed:

  • Notifier.Close(): Should not close the underlying dbus.Conn that is owned by caller.

Breaking changes:

Changes:

  • requires go 1.13 for fmt.Errorf(%w) formatting
  • Notifier.CloseNotification(id int) is now CloseNotification(id uint32) to be in line with the uint32 IDs returned.

Removed:

  • NotificationClosed() <-chan *NotificationClosedSignal
  • ActionInvoked() <-chan *ActionInvokedSignal

Removed interface methods producing chans because most users found it awkward to use.
Added callback functions instead.

Added:

  • Added callback functions instead of methods returning a shared chan:
    • NotificationClosedHandler: called when we receive a NotificationClosed signal
    • ActionInvokedHandler: called when we receive a signal that one of the action_keys was invoked
    • New(...): WithOnAction and WithOnClose options that lets you give a custom handler function.

The new callback based handler design fixes a few issues as well. It is now safe to create a instance without draining the output channel and we no longer need to spawn new goroutines just to avoid blocking even if the consumer is not interested in signals.