APIClient

Swift
public struct APIClient: Sendable

A Steam API Client to be periodically polled


Topics

Configuration

enum PollKind

The kind of polling to perform

Declaration
Swift
public enum PollKind: Sendable

init(SteamBaseAPI?, pollKind: PollKind, interval: TimeInterval, name: String)

Create a new client to be polled

Declaration
Swift
public init(
    _ steam: SteamBaseAPI?, pollKind: PollKind = .runCallbacks,
    interval: TimeInterval = 0.1, name: String = "APIClient")
Parameters
steam

A SteamAPI or SteamGameServerAPI to be polled.

pollKind

What kind of polling to perform. Default is .runCallbacks which means Steamworks callbacks can occur on the executor’s thread.

interval

How often to make the polling call. More precisely, this time is left between calls to the polling function. No attempt is made to claw back lost time or account for time spent polling.

name

A name for this client, used for stats and debug.

Properties

var steam: SteamBaseAPI?

The Steamworks API being polled

Declaration
Swift
public let steam: SteamBaseAPI?

var pollKind: PollKind

The kind of polling being done

Declaration
Swift
public let pollKind: PollKind

var interval: TimeInterval

How frequently the API is polled

Declaration
Swift
public let interval: TimeInterval

var name: String

An identifier for this client, used for stats and debug

Declaration
Swift
public let name: String