RMNetworkTransport
Objective-C
@protocol RLMNetworkTransport <NSObject>
Swift
protocol RLMNetworkTransportProtocol : NSObjectProtocol, Sendable
外部インターフェースのトランスポートプロトコル。 カスタム リクエスト/レスポンスの処理が可能になります。
-
指定されたエンドポイントにリクエストを送信します。
宣言
Objective-C
- (void)sendRequestToServer:(nonnull RLMRequest *)request completion:(nonnull RLMNetworkTransportCompletionBlock) completionBlock;
Swift
func sendRequest(toServer request: RLMRequest) async -> RLMResponse
パラメーター
request
送信リクエスト。
completionBlock
リクエストの完了時に呼び出されるコールバック。
-
イベント ストリーム リクエストを開始します。
宣言
Objective-C
- (nonnull NSURLSession *)doStreamRequest:(nonnull RLMRequest *)request eventSubscriber: (nonnull id<RLMEventDelegate>)subscriber;
Swift
func doStreamRequest(_ request: RLMRequest, eventSubscriber subscriber: any RLMEventDelegate) -> URLSession
パラメーター
request
開始する RMRequest 。
subscriber
サーバーからの変更をサブスクライブする RRMEventDelegate 。