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

Async Matrix.toBuffer() #21

Closed
yocontra opened this issue Oct 25, 2012 · 8 comments
Closed

Async Matrix.toBuffer() #21

yocontra opened this issue Oct 25, 2012 · 8 comments

Comments

@yocontra
Copy link
Contributor

I can grab 48233 camera frames per second but when I add a toBuffer() into the mix that number drops to 27. This is still fine for streaming video but if toBuffer was asynchronous it would probably be pretty high - is it possible to put the memcopy out into an async task using libuv?

@peterbraden
Copy link
Owner

Yeah, this seems reasonable.

peterbraden added a commit that referenced this issue Oct 30, 2012
@peterbraden
Copy link
Owner

Ok, do you want to try this out in the async-toBuffer branch? There's a new method called toBufferAsync(cb) on matrix.

I know this is kinda ugly, and at some point I can conceive switching the default behaviour to be async, and have the sync method be called toBufferSync, to match the other node modules, but I don't want to break peoples code at this point.

@yocontra
Copy link
Contributor Author

Why not do it node-canvas style and run sync if toBuffer receives no arguments and async if it receives a callback?

@peterbraden
Copy link
Owner

Great idea, ok, gonna merge it into master now.

@yocontra
Copy link
Contributor Author

Has this been published to npm?

@peterbraden
Copy link
Owner

not yet - I have another branch I was hoping to get done before bumping the
version, but let me do it for you now.

On 12 November 2012 12:03, Eric Schoffstall notifications@github.comwrote:

Has this been published to npm?


Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-10302088.

Peter Braden

http://PeterBraden.co.uk/

@yocontra
Copy link
Contributor Author

It's fine I can just put the git master url in my package.json - was JW

@peterbraden
Copy link
Owner

I just bumped it anyway - should be at 0.0.9

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

No branches or pull requests

2 participants