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

Support creating, getting and putting to native Go channels #23

Open
alanjds opened this issue Aug 21, 2018 · 7 comments
Open

Support creating, getting and putting to native Go channels #23

alanjds opened this issue Aug 21, 2018 · 7 comments
Labels
imported Imported from google/grumpy

Comments

@alanjds
Copy link

alanjds commented Aug 21, 2018

google#96 opened by @mattseh on 12 Jan 2017

Hi,

Very cool project.

I grepped the code, but couldn't find a mention of channels or goroutines.

Are they available, either directly or via the python stdlib?

Thanks

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by trotterdylan
Thursday Jan 12, 2017 at 16:27 GMT


Thanks for the interest in the project! The normal Python threading libraries are based on goroutines. So for example, this will implicitly start a goroutine:

import threading
def target():
  print 'from a goroutine!'
t = threading.Thread(target=target)
t.start()
t.join()

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by trotterdylan
Thursday Jan 12, 2017 at 16:28 GMT


Channels will be exposed implicitly as Queue objects. They will also be directly usable as native Go objects, but that work has not yet been done. Reopening this to capture that work.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by toadzhou
Friday Jan 13, 2017 at 05:20 GMT


very good project! Sustained attention
# go build -o hello hello.go
/root/grumpy/build/src/grumpy/file.go:18:2: non-standard import "bufio" in standard package "grumpy"
/root/grumpy/build/src/grumpy/lib/threading/module.go:4:2: non-standard import "reflect" in standard package "grumpy/lib/threading"
import cycle not allowed
package main
imports grumpy
imports bufio
imports bytes
imports errors
imports runtime
imports runtime/internal/atomic
imports unsafe
imports runtime

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by trotterdylan
Friday Jan 13, 2017 at 05:24 GMT


@toadzhou I think that's a different issue. Can you file a different issue? It would be useful to see the output of go version.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by meadori
Thursday Jan 19, 2017 at 01:52 GMT


I would like to take a stab at implementing Queues in terms of channels if no one is working on it yet.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by trotterdylan
Thursday Jan 19, 2017 at 02:12 GMT


It's not being worked on to my knowledge.
On Wed, Jan 18, 2017 at 5:52 PM Meador Inge notifications@github.com
wrote:

I would like to take a stab at implementing Queues in terms of channels
if no one is working on it yet.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
google#96 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAHLexFQaT4Ntrn74n2g_SSz3UdZG6llks5rTsHOgaJpZM4LhiXN
.

@alanjds
Copy link
Author

alanjds commented Aug 21, 2018

Comment by choleraehyq
Thursday Jan 19, 2017 at 07:49 GMT


I don't think implementing Queue based on channal is a good idea. Even in Go, we often reimplement a queue without channals rather than using channals.

How do you think about refactoring threading.Event using channal?

@alanjds alanjds added the imported Imported from google/grumpy label Aug 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported Imported from google/grumpy
Projects
None yet
Development

No branches or pull requests

1 participant