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

Migrate chat to async way #22

Open
jeffhsta opened this issue Aug 8, 2016 · 3 comments
Open

Migrate chat to async way #22

jeffhsta opened this issue Aug 8, 2016 · 3 comments
Assignees

Comments

@jeffhsta
Copy link
Member

jeffhsta commented Aug 8, 2016

I want to rise a discussion about refactor our app to program in asynchronous way.

Since we are using Python 3.4 and just Python 3.5 will came with async syntax sugar, I am proposing to use Twisted

https://twistedmatrix.com/trac/

I want to know the team opinion about that.
@ruanLN @Dkmister @mateusriad @leormarqs @pfvscheffer

@ruanLN
Copy link

ruanLN commented Aug 8, 2016

I think it'll add unnecessary complexity to the project, maybe a synchronous approach using select command to iterate among the sockets give a similar readability/efficiency, without the async programming headache

@jeffhsta
Copy link
Member Author

@ruanLN Ok, your point make totally sense to me.

Lets continue on our current approach. I have to take a look in this "select" if there is possible, share some content about it with the team.

@ruanLN
Copy link

ruanLN commented Aug 12, 2016

@jeffhsta take a look in client.py#16,
here I use the select to switch between stdin and the server socket, the select command return a list of io_devices with bytes ready to read, then you can iterate over this list.
the main diference for the server side is that you'll add a socket in socket_list for each connected client.
This package supports a lot of other things not so interesting for us right now: select.

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