Learn Data Structures and Algorithms with Golang
上QQ阅读APP看书,第一时间看更新

The StartTicketIssue method 

The StartTicketIssue method starts the issuing of a ticket for passengers standing in a queue. The StartTicketIssue method on Queue sends messageTicketStart to the message queue and queueTicket receives the message. The ticket issue is started by sending messages to the queue, as follows:

// StartTicketIssue starts the ticket issue
func (Queue *Queue) StartTicketIssue() {
Queue.message <- messageTicketStart
<-Queue.queueTicket
}