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

[question] Channel functions #2

Open
zeroware opened this issue Jan 20, 2016 · 3 comments
Open

[question] Channel functions #2

zeroware opened this issue Jan 20, 2016 · 3 comments
Labels

Comments

@zeroware
Copy link

Hello,

Are you planning on binding the channels operations from libmill in JS ?

If yes , I may be able to help !

@zeroware zeroware changed the title [question] Channels functions [question] Channel functions Jan 20, 2016
@reqshark
Copy link
Owner

yes, that is the goal! 👍

I think that would reduce avoid complexity of libuv integrated callbacks and simplify JS internal operations.

I've been thinking about how to do that, and I'm not sure if we need to spin up a process or something separate first to conduct libmill coroutines and channel operations independently.. or just bind them directly and call them straight. if you have ideas for how to do that with channel operations in JS, any help would be most welcome :)

@zeroware
Copy link
Author

I don't have much experience with binding native lib with node but i've been using the js-csp project.
I don't know if you can reproduce the use of yield with a libmill implementation.

@reqshark
Copy link
Owner

I think it's possible, because yielding cpu to other co-routines was part of the lib's design:

void yield(void);

By calling this function you give other coroutines a chance to run.

You should consider using yield() when doing lengthy computations which don't involve natural coroutine switching points such as network operations.

The function has no return value, nor can it return an error.

It looks like Libmill's yield implementation is inverted compared to js-csp

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

No branches or pull requests

2 participants