EngineClient
public class EngineClient : BaseClient
Responsible for retrieving prediction results from a PredictionIO Engine Server.
-
Creates a client instance to connect to the Engine Server.
Declaration
Swift
public override init(baseURL: String = "http://localhost:8000", timeout: TimeInterval = 5)Parameters
baseURLThe base URL of the Engine Server.
http://localhost:8000by default.timeoutThe request timeout. 5 seconds by default.
Return Value
The
EngineClientinstance.
-
Queries the prediction engine.
Declaration
Swift
public func sendQuery(_ query: [String: Any], completionHandler: @escaping (Result<Data, PIOError>) -> Void)Parameters
queryThe query dictionary.
completionHandlerThe callback to be executed when the request has finished.
-
Queries the prediction engine and parses the response into the given response type.
Declaration
Swift
public func sendQuery<Response>(_ query: [String: Any], responseType: Response.Type, completionHandler: @escaping (Result<Response, PIOError>) -> Void) where Response: DecodableParameters
queryThe query dictionary.
responseTypeThe type respresenting the response format. It must conform to
Decodable.completionHandlerThe callback to be executed when the request has finished.
View on GitHub
Install in Dash
EngineClient Class Reference