Skip to content

Example for two way communication with a background goroutine #1244

Open
@mdepot

Description

@mdepot

This is to request a new example showing two way communication between bubbletea and a background process (running as a goroutine.) There are already two examples (send-msg and realtime) which demonstrate one way communication with bubbletea, however it would seem to be a common use case to need two way communication.

For example, the background process may do some work and need to be able to push updates into the model so that the results can be displayed in the interface. But it also makes sense that the background process might want to change its behavior based on the user interacting with the interface, meaning it also needs to also be able to pull information from the model. It would be great to have an example showing this two way communication, a background goroutine that changes its behavior based on flags in the model, as well as the model being updated based on work done in the background goroutine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions