RLMChangeEventDelegate

Objective-C

@protocol RLMChangeEventDelegate

Swift

protocol RLMChangeEventDelegate

Delegate which is used for subscribing to changes on a [RLMMongoCollection watch] stream.

  • The stream was opened.

    Declaration

    Objective-C

    - (void)changeStreamDidOpen:(nonnull RLMChangeStream *)changeStream;

    Swift

    func changeStreamDidOpen(_ changeStream: RLMChangeStream)

    Parameters

    changeStream

    The RLMChangeStream subscribing to the stream changes.

  • The stream has been closed.

    Declaration

    Objective-C

    - (void)changeStreamDidCloseWithError:(nullable NSError *)error;

    Swift

    func changeStreamDidCloseWithError(_ error: (any Error)?)

    Parameters

    error

    If an error occured when closing the stream, an error will be passed.

  • A error has occured while streaming.

    Declaration

    Objective-C

    - (void)changeStreamDidReceiveError:(nonnull NSError *)error;

    Swift

    func changeStreamDidReceiveError(_ error: any Error)

    Parameters

    error

    The streaming error.

  • Invoked when a change event has been received.

    Declaration

    Objective-C

    - (void)changeStreamDidReceiveChangeEvent:(nonnull id<RLMBSON>)changeEvent;

    Swift

    func changeStreamDidReceiveChangeEvent(_ changeEvent: any RLMBSON)

    Parameters

    changeEvent

    The change event in BSON format.