Documentation ¶
Index ¶
- Constants
- type AsyncHandler
- type LinesToRead
- type TaskOpts
- type ViewBufferManager
- func (self *ViewBufferManager) Close()
- func (m *ViewBufferManager) GetTaskKey() string
- func (self *ViewBufferManager) NewCmdTask(start func() (*exec.Cmd, io.Reader), prefix string, linesToRead LinesToRead, ...) func(TaskOpts) error
- func (self *ViewBufferManager) NewTask(f func(TaskOpts) error, key string) error
- func (self *ViewBufferManager) ReadLines(n int)
Constants ¶
const COMMAND_START_THRESHOLD = time.Millisecond * 10
we use this to check if the system is under stress right now. Hopefully this makes sense on other machines
const THROTTLE_TIME = time.Millisecond * 30
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncHandler ¶ added in v0.30.1
type AsyncHandler struct {
// contains filtered or unexported fields
}
the purpose of an AsyncHandler is to ensure that if we have multiple long-running requests, we only handle the result of the latest one. For example, if I am searching for 'abc' and I have to type 'a' then 'b' then 'c' and each keypress dispatches a request to search for things with the string so-far, we'll be searching for 'a', 'ab', and 'abc', and it may be that 'abc' comes back first, then 'ab', then 'a' and we don't want to display the result for 'a' just because it came back last. AsyncHandler keeps track of the order in which things were dispatched so that we can ignore anything that comes back late.
func NewAsyncHandler ¶ added in v0.30.1
func NewAsyncHandler(onWorker func(func(gocui.Task))) *AsyncHandler
func (*AsyncHandler) Do ¶ added in v0.30.1
func (self *AsyncHandler) Do(f func() func())
type LinesToRead ¶ added in v0.38.0
type TaskOpts ¶ added in v0.39.0
type TaskOpts struct { // Channel that tells the task to stop, because another task wants to run. Stop chan struct{} // Only for tasks which are long-running, where we read more lines sporadically. // We use this to keep track of when a user's action is complete (i.e. all views // have been refreshed to display the results of their action) InitialContentLoaded func() }
type ViewBufferManager ¶
func NewViewBufferManager ¶
func (*ViewBufferManager) Close ¶
func (self *ViewBufferManager) Close()
Close closes the task manager, killing whatever task may currently be running
func (*ViewBufferManager) GetTaskKey ¶ added in v0.30.1
func (m *ViewBufferManager) GetTaskKey() string
func (*ViewBufferManager) NewCmdTask ¶
func (self *ViewBufferManager) NewCmdTask(start func() (*exec.Cmd, io.Reader), prefix string, linesToRead LinesToRead, onDoneFn func()) func(TaskOpts) error
func (*ViewBufferManager) NewTask ¶
func (self *ViewBufferManager) NewTask(f func(TaskOpts) error, key string) error
func (*ViewBufferManager) ReadLines ¶
func (self *ViewBufferManager) ReadLines(n int)