Blue Brain BioExplorer
core::Throttle Struct Reference

#include <Throttle.h>

Public Types

using Function = std::function< void()>
 

Public Member Functions

void operator() (const Function &fn, const int64_t wait=100)
 
void operator() (const Function &fn, const Function &later, const int64_t wait=100)
 

Detailed Description

Executes the given function at most once every 'wait' milliseconds.

Inspired by https://remysharp.com/2010/07/21/throttling-function-calls.

Definition at line 33 of file Throttle.h.

Member Typedef Documentation

◆ Function

using core::Throttle::Function = std::function<void()>

Definition at line 35 of file Throttle.h.

Member Function Documentation

◆ operator()() [1/2]

void core::Throttle::operator() ( const Function fn,
const Function later,
const int64_t  wait = 100 
)

Definition at line 44 of file Throttle.cpp.

◆ operator()() [2/2]

void core::Throttle::operator() ( const Function fn,
const int64_t  wait = 100 
)

Definition at line 39 of file Throttle.cpp.


The documentation for this struct was generated from the following files: