You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a bit of code from the function (*Robot) Start(args ...interface{}) error starting on line 160 of the file gobot/robot.go. Lines 180 through 183 are:
go func () { r.Work() <- r.done }()
Typically, the function "Work" is an infinite loop. That means that <-done would not be ordinarily reachable. Hence the robot can't be stopped by this signal since the Stop function relies on sending a signal on the r.done channel. That has been my experience in my Raspberry Pi project.
The text was updated successfully, but these errors were encountered:
After some experimentation and research, I decided to abandon using the robot. I put the work function into a go routine and passed it a context with cancel. I have tested it and it seems to work well.
Here is a bit of code from the function
(*Robot) Start(args ...interface{}) error
starting on line 160 of the file gobot/robot.go. Lines 180 through 183 are:go func () { r.Work() <- r.done }()
Typically, the function "Work" is an infinite loop. That means that <-done would not be ordinarily reachable. Hence the robot can't be stopped by this signal since the Stop function relies on sending a signal on the r.done channel. That has been my experience in my Raspberry Pi project.
The text was updated successfully, but these errors were encountered: