Sise.subscribe

You're seeing just the function subscribe, go back to Sise module for more information.
Link to this function

subscribe(notification_type)

View Source

Specs

subscribe(nt()) :: nil

Subscribe to receive notifications about discoveries

When calling this function, the caller will

  • receive a notification message of type :ssdp_add for every already known discovery
  • receive a message for every change in the future

It is possible to subscribe to multiple different notification types.

The possible notification messages to be received are these:

{:ssdp_add, Sise.Discovery.t()}

This message informs that a new device or service has been discovered. It will contain a struct with all available information on the discovery.

{:ssdp_update, Sise.Discovery.t(), [{atom(), String.t(), String.t()}]}

Informs the listener that the available information about a known device/service has changed. The message will carry the new version of the Discovery struct. It will also carry a list with the differences between the old and the new device/service information.

{:ssdp_delete, Sise.Discovery.t()}

Informs that a device/service is no longer available. The message will carry the last known version of the Discovery struct. See also Sise.Discovery.diff/2.