MCPcopy
hub / github.com/charmbracelet/bubbletea / Send

Method Send

tea.go:1183–1188  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
1183func (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.

Callers 15

suspendMethod · 0.95
checkResizeMethod · 0.95
execMethod · 0.95
handleCommandsMethod · 0.95
eventLoopMethod · 0.95
execSequenceMsgMethod · 0.95
execBatchMsgMethod · 0.95
RunMethod · 0.95
QuitMethod · 0.95

Calls

no outgoing calls

Tested by 12

TestTeaBatchMsgFunction · 0.76
TestTeaSequenceMsgFunction · 0.76
TestTeaNestedSequenceMsgFunction · 0.76
TestTeaSendFunction · 0.76
TestTeaPanicFunction · 0.76
TestTeaGoroutinePanicFunction · 0.76
TestViewModelFunction · 0.76
TestClearMsgFunction · 0.76