3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 18:52:41 +01:00

Make channels synchronous.

This commit is contained in:
Jeremy Latt 2013-06-02 16:53:06 -07:00
parent 74aaf2f9d3
commit 0001131095
5 changed files with 7 additions and 7 deletions

View File

@ -49,8 +49,8 @@ type ChannelCommand interface {
// NewChannel creates a new channel from a `Server` and a `name` string, which
// must be unique on the server.
func NewChannel(s *Server, name string) *Channel {
commands := make(chan ChannelCommand, 1)
replies := make(chan Reply, 1)
commands := make(chan ChannelCommand)
replies := make(chan Reply)
channel := &Channel{
name: name,
members: make(UserSet),

View File

@ -31,7 +31,7 @@ type ClientSet map[*Client]bool
func NewClient(server *Server, conn net.Conn) *Client {
read := StringReadChan(conn)
write := StringWriteChan(conn)
replies := make(chan Reply, 1)
replies := make(chan Reply)
client := &Client{
conn: conn,

View File

@ -29,7 +29,7 @@ type Server struct {
}
func NewServer(name string) *Server {
commands := make(chan Command, 1)
commands := make(chan Command)
server := &Server{
ctime: time.Now(),
name: name,

View File

@ -29,7 +29,7 @@ type BaseService struct {
}
func NewService(service EditableService, s *Server, name string) Service {
commands := make(chan ServiceCommand, 1)
commands := make(chan ServiceCommand)
base := &BaseService{
server: s,
name: name,

View File

@ -47,8 +47,8 @@ func (set UserSet) Nicks() []string {
}
func NewUser(nick string, server *Server) *User {
commands := make(chan UserCommand, 1)
replies := make(chan Reply, 1)
commands := make(chan UserCommand)
replies := make(chan Reply)
user := &User{
nick: nick,
server: server,