concurrent-ruby icon indicating copy to clipboard operation
concurrent-ruby copied to clipboard

CSP channels implementation

Open lloeki opened this issue 9 years ago • 4 comments

I've had some chat with @coding-horror over Twitter and concurrent-ruby was brought again to my mind, so I went on to look for the channel implementation, which I found to be lacking. Turns out I've had some implementation collecting dust, so maybe someone over here could make use of this.

I strived to keep the implementation simple, keeping the Go spirit while still being idiomatic Ruby: take a look at the examples and open the corresponding Go by Example page.

The implementation is almost feature complete save for non-blocking select, for which I'm still looking for a straightforward and idiomatic syntax.

Anyway, feel free to ignore this if you don't feel like it's fit for this project.

lloeki avatar Feb 14 '16 16:02 lloeki

Absolutely, I'd love your assistance with channels. Thank you!

The new implementation I started several months back is still very experimental, incomplete, and buggy. I haven't had much time to revisit lately. I've only looked at your implementation briefly but yours is definitely simpler and more elegant. It's probably a better base to work from than what I've created. There are tools within concurrent-ruby that we can leverage (Synchronization::LockableObject, thread pools, etc.) but those updates can happen incrementally.

Are you interested in becoming a contributor? If so we'd love to have your help (a similar conversation over actors is how @pitr-ch got involved in the project--we adopted his implementation in lieu of mine). Please feel free to create a PR that replaces out existing channels with yours. Or I can do the work myself if you would prefer. It's your code so I'll support whatever works best for you.

jdantonio avatar Feb 15 '16 14:02 jdantonio

Well, becoming a contributor sounds nice :-) However small a piece, I'd like to help Ruby stay relevant in modern times.

I'll get things going locally, and start getting the hang of concurrent-ruby's layout and conventions.

lloeki avatar Feb 15 '16 18:02 lloeki

@lloeki welcome! If you have any questions about Synchronization layer don't hesitate to ask me. Side note: Please use only Synchronization::Object. LockableObject may have been a step in wrong direction and can go away.

pitr-ch avatar Feb 16 '16 21:02 pitr-ch

Time sure flies. Finally started working on this a bit, tracked in #519.

lloeki avatar Mar 12 '16 09:03 lloeki