Skip to content

Commit

Permalink
added warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sdiehl committed Apr 17, 2011
1 parent 37e092c commit 668494f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
10 changes: 8 additions & 2 deletions apps/chat/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ def send_message(socket, room, text):
socket.send_unicode("%s:%s" % (room, text))

def message_listener(socketio, room):
context = zmq.Context()
# For too many threads spawning new connection will cause a
# "too many mailboxes" error, but for small amounts of
# threads this is fine.

subscriber = context.socket(zmq.SUB)
subscriber.connect("tcp://127.0.0.1:5000")

Expand All @@ -40,7 +43,10 @@ def new_room(socket, room_name):
socket.send("room:%s" % str(room_name))

def room_listener(socketio):
context = zmq.Context()
# For too many threads spawning new connection will cause a
# "too many mailboxes" error, but for small amounts of
# threads this is fine.

subscriber = context.socket(zmq.SUB)
subscriber.connect("tcp://127.0.0.1:5000")
subscriber.setsockopt(zmq.SUBSCRIBE, 'room')
Expand Down
1 change: 0 additions & 1 deletion run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
application = django.core.handlers.wsgi.WSGIHandler()

sys.path.insert(0, os.path.join(settings.PROJECT_ROOT, "../"))
sys.path.insert(0, os.path.join(settings.PROJECT_ROOT, "apps"))

if __name__ == '__main__':
Expand Down
1 change: 0 additions & 1 deletion settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Django settings for TicTacToe project.
import os

PROJECT_ROOT = os.path.dirname(__file__)
Expand Down

0 comments on commit 668494f

Please sign in to comment.