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 basic libuv linkage #10

Open
Fishrock123 opened this issue Aug 6, 2016 · 2 comments
Open

Implement basic libuv linkage #10

Fishrock123 opened this issue Aug 6, 2016 · 2 comments

Comments

@Fishrock123
Copy link
Member

This would probably be easiest to start by integrating uv_loop and uv_handle , and then implementing uv_timer*.

@creationix
Copy link
Member

Yep. I've written libuv bindings about 6 times now, timer is the easiest place to start. It's simple and easy to test. Then I would tackle TCP. It's one of the hardest and touches all the tough parts in design because it deals with multiple levels of methods in libuv and has a mix of handle methods some with requests and some without. The hardest stuff is in uv_stream_t, but that's required by uv_tcp_t.

Once you have Timer and TCP, most the rest is straightforward. Spawn is probably the remaining tricky one as it's got some parts a little different.

@creationix
Copy link
Member

Oh and in a single-threaded system like JavaScript, There is little reason to expose the loop instance directly. I tend to create one loop per VM instance (which is generally also per OS thread). This is better than simply using the default loop, but still hides loop instance management from JavaScript.

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

2 participants