TootDataStream

public actor TootDataStream

Provides a holder that returns streams of AsyncSequence data that can be refreshed, posts, account data etc

Initialization

  • Initialises a TootStream with a given client, it is assumed the client is authorized already

    Declaration

    Swift

    public init(client: TootClient)

    Parameters

    client

    TootClient to provide data streams for

Updating data

  • refreshStreams() Asynchronous

    Reloads data in all currently active streams

    Declaration

    Swift

    public func refreshStreams() async throws
  • refresh(_:) Asynchronous

    Reloads data in the selected stream for account toot streams

    Declaration

    Swift

    public func refresh(_ stream: AccountTootStreams) async throws

Account stream creation

  • Provides an async stream of updates for the given stream

    Declaration

    Swift

    public func stream(_ stream: AccountTootStreams) throws -> AsyncStream<Account>

    Parameters

    stream

    the stream type to update

    Return Value

    async stream of values

Post stream creation

  • Provides an async stream of updates for the given stream

    Declaration

    Swift

    public func stream(_ timeline: Timeline, _ pageInfo: PagedInfo? = nil) throws -> AsyncStream<[Post]>

    Parameters

    timeline

    the type of post stream to update

    pageInfo

    PagedInfo object for max/min/since ids

    Return Value

    async stream of Post values

  • refresh(_:) Asynchronous

    Reloads data in the selected stream for post toot streams

    Declaration

    Swift

    public func refresh(_ timeline: Timeline) async throws