AWS IoT Device SDK C++ v2  1.34.0
AWS IoT Device SDK C++ v2
Public Member Functions | List of all members
Aws::Crt::Io::EventLoopGroup Class Referencefinal

#include <EventLoopGroup.h>

Public Member Functions

 EventLoopGroup (uint16_t threadCount=0, Allocator *allocator=ApiAllocator()) noexcept
 
 EventLoopGroup (uint16_t cpuGroup, uint16_t threadCount, Allocator *allocator=ApiAllocator()) noexcept
 
 ~EventLoopGroup ()
 
 EventLoopGroup (const EventLoopGroup &)=delete
 
 EventLoopGroup (EventLoopGroup &&) noexcept
 
EventLoopGroupoperator= (const EventLoopGroup &)=delete
 
EventLoopGroupoperator= (EventLoopGroup &&) noexcept
 
 operator bool () const
 
int LastError () const
 

Detailed Description

A collection of event loops.

An event-loop is a thread for doing async work, such as I/O. Classes that need to do async work will ask the EventLoopGroup for an event-loop to use.

The number of threads used depends on your use-case. IF you have a maximum of less than a few hundred connections 1 thread is the ideal threadCount.

There should only be one instance of an EventLoopGroup per application and it should be passed to all network clients. One exception to this is if you want to peg different types of IO to different threads. In that case, you may want to have one event loop group dedicated to one IO activity and another dedicated to another type.

Constructor & Destructor Documentation

◆ EventLoopGroup() [1/4]

Aws::Crt::Io::EventLoopGroup::EventLoopGroup ( uint16_t  threadCount = 0,
Allocator allocator = ApiAllocator() 
)
noexcept
Parameters
threadCountThe number of event-loops to create, default will be 0, which will create one for each processor on the machine.
allocatormemory allocator to use.

◆ EventLoopGroup() [2/4]

Aws::Crt::Io::EventLoopGroup::EventLoopGroup ( uint16_t  cpuGroup,
uint16_t  threadCount,
Allocator allocator = ApiAllocator() 
)
noexcept
Parameters
cpuGroupThe CPU group (e.g. NUMA nodes) that all hardware threads are pinned to.
threadCountThe number of event-loops to create, default will be 0, which will create one for each processor on the machine.
allocatormemory allocator to use.

◆ ~EventLoopGroup()

Aws::Crt::Io::EventLoopGroup::~EventLoopGroup ( )

◆ EventLoopGroup() [3/4]

Aws::Crt::Io::EventLoopGroup::EventLoopGroup ( const EventLoopGroup )
delete

◆ EventLoopGroup() [4/4]

Aws::Crt::Io::EventLoopGroup::EventLoopGroup ( EventLoopGroup &&  toMove)
noexcept

Member Function Documentation

◆ LastError()

int Aws::Crt::Io::EventLoopGroup::LastError ( ) const
Returns
the value of the last aws error encountered by operations on this instance.

◆ operator bool()

Aws::Crt::Io::EventLoopGroup::operator bool ( ) const
Returns
true if the instance is in a valid state, false otherwise.

◆ operator=() [1/2]

EventLoopGroup& Aws::Crt::Io::EventLoopGroup::operator= ( const EventLoopGroup )
delete

◆ operator=() [2/2]

EventLoopGroup & Aws::Crt::Io::EventLoopGroup::operator= ( EventLoopGroup &&  toMove)
noexcept

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