Skip to content

Latest commit

 

History

History
104 lines (67 loc) · 1.99 KB

SluClient.md

File metadata and controls

104 lines (67 loc) · 1.99 KB

SluClient

An SluClientProtocol that is implemented on top of public Speechly SLU gRPC API. Uses swift-grpc for handling gRPC streams and connectivity.

public class SluClient

Inheritance

SluClientProtocol

Nested Type Aliases

SluApiClient

An alias for Speechly SLU client protocol.

public typealias SluApiClient = Speechly_Slu_V1_SLUClientProtocol

Initializers

init(addr:loopGroup:delegateQueue:)

Creates a new client.

public convenience init(addr: String, loopGroup: EventLoopGroup, delegateQueue: DispatchQueue = DispatchQueue(label: "com.speechly.iosclient.SluClient.delegateQueue")) throws

Parameters

  • addr: The address of Speechly SLU API to connect to.
  • loopGroup: The NIO.EventLoopGroup to use in the client.
  • delegateQueue: The DispatchQueue to use for calling the delegate.

init(client:group:delegateQueue:)

Creates a new client.

public init(client: SluApiClient, group: EventLoopGroup, delegateQueue: DispatchQueue)

Parameters

  • client: The SluApiClient to use for creating SLU streams.
  • group: The NIO.EventLoopGroup to use in the client.
  • delegateQueue: The DispatchQueue to use for calling the delegate.

Properties

delegate

var delegate: SluClientDelegate?

Methods

connect(token:config:)

public func connect(token: ApiAccessToken, config: SluConfig) -> EventLoopFuture<Void>

disconnect()

public func disconnect() -> EventLoopFuture<Void>

startContext(appId:)

public func startContext(appId: String? = nil) -> EventLoopFuture<Void>

stopContext()

public func stopContext() -> EventLoopFuture<Void>

resume()

public func resume() -> EventLoopFuture<Void>

suspend()

public func suspend() -> EventLoopFuture<Void>

write(data:)

public func write(data: Data) -> EventLoopFuture<Void>