RIAEvangelist / node-phidget-API

Node.JS Phidget API supporting all phidgets!
Other
10 stars 7 forks source link

Events not re-firing when reconnecting #21

Closed MaybeRex closed 9 years ago

MaybeRex commented 9 years ago
   'connected'

and

   'phidgetReady'

are both not firing when reconnecting

RIAEvangelist commented 9 years ago

So I figured out why this is :

By design when the phidget is disconnected it is destroyed. If upon the disconnected event you were to automatically try phidget connect again, the next connected and phidget ready event would fire wh en they happened.

Perhaps though we should consider adding in a retry key in the connect object.

I think this might be more obvious and KISS for other developers using the API. What do you think @MaybeRex ?

MaybeRex commented 9 years ago

I think this is a great idea for a few reasons. Instead of possibly overhauling the api and making changes that might cause further issues, a retry event would have a lot of transparency and I think it is very KISS

RIAEvangelist commented 9 years ago

OK, it's settled thats what we'll do.