RLMNetworkTransport
@protocol RLMNetworkTransport <NSObject>
Transporting protocol for foreign interfaces. Allows for custom request/response handling.
-
Sends a request to a given endpoint.
Declaration
Objective-C
- (void)sendRequestToServer:(nonnull RLMRequest *)request completion:(nonnull RLMNetworkTransportCompletionBlock) completionBlock;
Swift
func sendRequest(toServer request: RLMRequest, completion completionBlock: @escaping RLMNetworkTransportCompletionBlock)
Parameters
request
The request to send.
completionBlock
A callback invoked on completion of the request.
-
Starts an event stream request.
Declaration
Objective-C
- (nonnull NSURLSession *)doStreamRequest:(nonnull RLMRequest *)request eventSubscriber: (nonnull id<RLMEventDelegate>)subscriber;
Swift
func doStreamRequest(_ request: RLMRequest, eventSubscriber subscriber: RLMEventDelegate) -> URLSession
Parameters
request
The RLMRequest to start.
subscriber
The RLMEventDelegate which will subscribe to changes from the server.