Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement callbacks #27

Open
Multiply opened this issue May 7, 2015 · 6 comments
Open

Implement callbacks #27

Multiply opened this issue May 7, 2015 · 6 comments
Milestone

Comments

@Multiply
Copy link

Multiply commented May 7, 2015

I want to do something like

robot.moveMouseSmoothly(x, y, function(coordinates, oldCoordinates) {
  console.log('Done moving');
});

Would this be possible to do for all methods, so we can chain them properly, and so the methods are not blocking.

@octalmage
Copy link
Owner

This is probably way better than #14, it's the Node.js way to do things.

Thanks for the suggestion, I'll keep it in mind.

@kilianc
Copy link

kilianc commented Jun 29, 2015

Better if returns a promise, a callback that doesn't have err as first parameter is not standard and not yieldable :)

Looks like we have no err to report, and having always nil seems unnecessary

@octalmage
Copy link
Owner

I'm still not sure how I should handle this, but I think it would be best to use callbacks with a delay in the C code. This way the commands are chainable, the delay is non-blocking, and we won't run into any OS limitations.

@skibz
Copy link

skibz commented Jul 30, 2015

callbacks 👍

@octalmage octalmage added this to the First Stable Release milestone May 30, 2016
@marcio199226
Copy link

Will be this feature implemented in any future releases ?

@ricardopolo
Copy link

Promises, async/await 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
@octalmage @kilianc @Multiply @ricardopolo @skibz @marcio199226 and others