ros-industrial-consortium / packml

ROS packml (https://en.wikipedia.org/wiki/PackML) support package
Apache License 2.0
9 stars 14 forks source link

Run Service Calls in a Separate Thread #33

Closed geoffreychiou closed 6 years ago

geoffreychiou commented 6 years ago

@joshuaplusone please review.

geoffreychiou commented 6 years ago

@shaun-edwards please merge when you get a chance.

shaun-edwards commented 6 years ago

I can't believe that took more than 4 lines...python disappoints ;)

Thanks @geoffreychiou for the updates

gavanderhoorn commented 6 years ago

Could either @geoffreychiou, @joshuaplusone or @shaun-edwards provide some rationale for this change? What does it fix? IIRC, according to documentation, rospy already spins off threads for incoming events?

joshuaplusone commented 6 years ago

@gavanderhoorn we were solving for an issue where spamming the service calls from the buttons was causing the UI to lock up and packml to crash. Our solution was to push outgoing service calls triggered by the buttons off of the UI thread so it wouldn't block the UI while they were running.

gavanderhoorn commented 6 years ago

Ah, that makes sense.

From a quick look I had not understood these were service clients.

Yeah, not using the UI thread for that is better.