Send sends a message to the main update function, effectively allowing messages to be injected from outside the program for interoperability purposes. If the program hasn't started yet this will be a blocking operation. If the program has already been terminated this will be a no-op, so it's safe t
(msg Msg)
| 1181 | // If the program has already been terminated this will be a no-op, so it's safe |
| 1182 | // to send messages after the program has exited. |
| 1183 | func (p *Program) Send(msg Msg) { |
| 1184 | select { |
| 1185 | case <-p.ctx.Done(): |
| 1186 | case p.msgs <- msg: |
| 1187 | } |
| 1188 | } |
| 1189 | |
| 1190 | // Quit is a convenience function for quitting Bubble Tea programs. Use it |
| 1191 | // when you need to shut down a Bubble Tea program from the outside. |
no outgoing calls