Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::service::v2::TimerableService Class Reference

Timerable Service. More...

#include <TimerableService_V2.h>

Inheritance diagram for sese::service::v2::TimerableService:
sese::iocp::v1::IOCPService

Public Member Functions

void dispatch (uint32_t timeout) override
 
virtual void onTimeout (v2::TimeoutEvent *event)
 
v2::TimeoutEventsetTimeoutEvent (int64_t seconds, void *data)
 
void cancelTimeoutEvent (v2::TimeoutEvent *event)
 

Private Attributes

TimeWheel timeWheel {}
 Time wheel.
 

Detailed Description

Timerable Service.

Member Function Documentation

◆ cancelTimeoutEvent()

◆ dispatch()

void TimerableService::dispatch ( uint32_t timeout)
override

Dispatch events

Parameters
timeoutTimeout duration

References sese::TimeWheel::check(), and timeWheel.

◆ onTimeout()

void TimerableService::onTimeout ( v2::TimeoutEvent * event)
virtual

Timeout callback function

Parameters
eventEvent

Reimplemented in sese::iocp::v1::IOCPService.

Referenced by setTimeoutEvent().

◆ setTimeoutEvent()

TimeoutEvent * TimerableService::setTimeoutEvent ( int64_t seconds,
void * data )

Set a timeout event

Parameters
secondsTimeout duration
dataAdditional data
Returns
Timeout event structure

References sese::TimeWheel::delay(), sese::service::v2::TimeoutEvent::event, onTimeout(), and timeWheel.

Referenced by sese::iocp::v1::IOCPServer::setTimeout().

Member Data Documentation

◆ timeWheel

TimeWheel sese::service::v2::TimerableService::timeWheel {}
private

Time wheel.

Referenced by cancelTimeoutEvent(), dispatch(), and setTimeoutEvent().


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