Skip to content

Commit

Permalink
deprecate: add deprecation notices for the DeviceHandler Listener
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski committed May 19, 2020
1 parent 21e5b03 commit daad6cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sdk/device_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ type DeviceHandler struct {
// other handler functions (e.g. read, write) defined. The listener function
// will run in a separate goroutine for each device. The goroutines are started
// before the read/write loops.
//
// NOTE: The Listen function is deprecated and will be removed in a future version
// of the SDK.
Listen func(*Device, chan *ReadContext) error

// Actions specifies a list of the supported write actions for the handler.
Expand Down
2 changes: 2 additions & 0 deletions sdk/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ func (scheduler *scheduler) scheduleListen() {
log.Info("[scheduler] listeners will not be scheduled (listening globally disabled)")
return
}
// DEPRECATE (etd)
log.Warning("[scheduler] Deprecation Warning: the SDK listener behavior for DeviceHandlers will be removed in a future release of the SDK")

if !scheduler.deviceManager.HasListenerHandlers() {
log.Info("[scheduler] listeners will not be scheduled (no listener handlers registered)")
Expand Down

0 comments on commit daad6cb

Please sign in to comment.