Keep hold of a room's name.

This commit is contained in:
Tony Garnock-Jones 2011-10-23 16:37:56 -04:00
parent fe6171201f
commit 69ee05d88c
1 changed files with 3 additions and 2 deletions

View File

@ -9,6 +9,7 @@
(require "standard-thread.rkt")
(provide make-room
room-name
join-room
;; Management and communication
@ -26,7 +27,7 @@
(struct credit (who amount) #:prefab) ;; give someone an amount of credit
(struct room (ch))
(struct room (name ch))
(struct room-state (name ch members) #:transparent)
(struct binding (name ;; any
@ -42,7 +43,7 @@
(define (make-room [name (gensym 'room)])
(define ch (make-channel))
(thread (lambda () (room-main (room-state name ch '()))))
(room ch))
(room name ch))
(define (join-room room [name (gensym 'peer)] #:break-on-departure? [break-on-departure? #f])
(make-object membership% (room-ch room) name break-on-departure?))