wxMaxima
Loading...
Searching...
No Matches
Functions
MaximaItemQueue.cpp File Reference

The hand-over of Maxima's output from the socket thread to the GUI. More...

#include "MaximaItemQueue.h"
Include dependency graph for MaximaItemQueue.cpp:

Functions

DrainResult DrainForAtMost (std::chrono::milliseconds budget, const std::function< bool(MaximaItemQueue::Item &)> &take, const std::function< bool(const MaximaItemQueue::Item &)> &dispatch)
 Hands items to dispatch() until none is left or the time is used up.
 

Detailed Description

The hand-over of Maxima's output from the socket thread to the GUI.

Function Documentation

◆ DrainForAtMost()

DrainResult DrainForAtMost ( std::chrono::milliseconds  budget,
const std::function< bool(MaximaItemQueue::Item &)> &  take,
const std::function< bool(const MaximaItemQueue::Item &)> &  dispatch 
)

Hands items to dispatch() until none is left or the time is used up.

Always handles at least one item, so a single item that takes longer than the whole budget can't stall the queue.

Parameters
budgetHow long to keep dispatching
takeFetches the next item; false if there is none
dispatchHandles one item; false stops the loop (for example because the connection the items came from is gone)