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
An alias for Speechly SLU client protocol.
public typealias SluApiClient = Speechly_Slu_V1_SLUClientProtocol
Creates a new client.
public convenience init(addr: String, loopGroup: EventLoopGroup, delegateQueue: DispatchQueue = DispatchQueue(label: "com.speechly.iosclient.SluClient.delegateQueue")) throws
- 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.
Creates a new client.
public init(client: SluApiClient, group: EventLoopGroup, delegateQueue: DispatchQueue)
- 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.
var delegate: SluClientDelegate?
public func connect(token: ApiAccessToken, config: SluConfig) -> EventLoopFuture<Void>
public func disconnect() -> EventLoopFuture<Void>
public func startContext(appId: String? = nil) -> EventLoopFuture<Void>
public func stopContext() -> EventLoopFuture<Void>
public func resume() -> EventLoopFuture<Void>
public func suspend() -> EventLoopFuture<Void>
public func write(data: Data) -> EventLoopFuture<Void>