mirror of
				https://github.com/ergochat/ergo.git
				synced 2025-10-31 05:47:22 +01:00 
			
		
		
		
	Make channels synchronous.
This commit is contained in:
		
							parent
							
								
									74aaf2f9d3
								
							
						
					
					
						commit
						0001131095
					
				| @ -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), | ||||
|  | ||||
| @ -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, | ||||
|  | ||||
| @ -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, | ||||
|  | ||||
| @ -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, | ||||
|  | ||||
| @ -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, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jeremy Latt
						Jeremy Latt