-
Notifications
You must be signed in to change notification settings - Fork 5
Fix creating new ports in erlang example #3
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
Comments
Thanks, one port is indeed enough. Mind submitting a PR? |
Yeah, ok. But i need some time to rework my local branch and then PR. |
Sure, no problem. I've noticed you're working on Async integration: is it possible to support Async without duplicating the parsing? |
At first i thought to totally rewrite current Alberto module and make new one Alberto_async, but now i decided to create a functor Alberto_async.Make that wraps original functions in async-scheduler-friendly way. So there is no code duplication of term parsing (as i can see, original parsing functions cannot stuck the scheduler), but reading and writing from std i/o is totally rewriten. If you have some suggestions for this functionality just tell me and i'll refactor this part in alberto-way. |
Alberto I/O interface is fairly minimal. Most of the parsing code is isolated into pure functions. There's an example of Lwt integration in |
I use alberto not only as an erlang-port library, primary it would be layer for close interaction with erlang message routers over tcp and udp, so there is some application-specific needs such as lazy evaluation of terms etc., wrapping original functions in deferred's is common api-style convertion in a project (graph-like db). |
Yours erlang example creates new port on every iteration. I think it's wrong and script should be fixed to the version like that:
There is no need to create hundreds of new ports.
The text was updated successfully, but these errors were encountered: