Skip to content

Commit

Permalink
Renamed classes using "Metadata" in their name to use "Params" instead.
Browse files Browse the repository at this point in the history
Also renamed `transition:` to `performTransitionToState` for realtime channel.
  • Loading branch information
maratal committed Feb 23, 2024
1 parent c7294f9 commit 77cc141
Show file tree
Hide file tree
Showing 11 changed files with 226 additions and 235 deletions.
99 changes: 49 additions & 50 deletions Ably.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "ARTAttachRequestMetadata.h"
#import "ARTAttachRequestParams.h"

@implementation ARTAttachRequestMetadata
@implementation ARTAttachRequestParams

- (instancetype)initWithReason:(ARTErrorInfo *)reason {
return [self initWithReason:reason channelSerial:nil];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "ARTChannelStateChangeMetadata.h"
#import "ARTChannelStateChangeParams.h"

@implementation ARTChannelStateChangeMetadata
@implementation ARTChannelStateChangeParams

- (instancetype)initWithState:(ARTState)state {
return [self initWithState:state errorInfo:nil storeErrorInfo:NO];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "ARTConnectionStateChangeMetadata.h"
#import "ARTConnectionStateChangeParams.h"

@implementation ARTConnectionStateChangeMetadata
@implementation ARTConnectionStateChangeParams

- (instancetype)init {
return [self initWithErrorInfo:nil];
Expand Down
180 changes: 89 additions & 91 deletions Source/ARTRealtime.m

Large diffs are not rendered by default.

124 changes: 59 additions & 65 deletions Source/ARTRealtimeChannel.m

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Source/Ably.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ framework module Ably {
header "ARTRetryDelayCalculator.h"
header "ARTBackoffRetryDelayCalculator.h"
header "ARTClientOptions+TestConfiguration.h"
header "ARTConnectionStateChangeMetadata.h"
header "ARTChannelStateChangeMetadata.h"
header "ARTAttachRequestMetadata.h"
header "ARTConnectionStateChangeParams.h"
header "ARTChannelStateChangeParams.h"
header "ARTAttachRequestParams.h"
header "ARTRetrySequence.h"
header "ARTTypes+Private.h"
header "ARTTestClientOptions.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
NS_ASSUME_NONNULL_BEGIN

/**
Provides metadata for a request to perform an operation that may ultimately call `ARTChannelRealtimeInternal`’s `internalAttach:callback:` method.
Provides parameters for a request to perform an operation that may ultimately call `ARTChannelRealtimeInternal`’s `internalAttach:callback:` method.
*/
NS_SWIFT_NAME(AttachRequestMetadata)
@interface ARTAttachRequestMetadata: NSObject
NS_SWIFT_NAME(AttachRequestParams)
@interface ARTAttachRequestParams: NSObject

/**
Information about the error that triggered this attach request, if any.
Expand All @@ -26,7 +26,7 @@ NS_SWIFT_NAME(AttachRequestMetadata)
- (instancetype)init NS_UNAVAILABLE;

/**
Creates an `ARTAttachRequestMetadata` instance with the given `reason`, whose `channelSerial` is `nil`.
Creates an `ARTAttachRequestParams` instance with the given `reason`, whose `channelSerial` is `nil`.
*/
- (instancetype)initWithReason:(nullable ARTErrorInfo *)reason;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
NS_ASSUME_NONNULL_BEGIN

/**
Provides metadata for a request to perform an operation that may cause an `ARTRealtimeChannelInternal` instance to emit a connection state change.
Provides parameters for a request to perform an operation that may cause an `ARTRealtimeChannelInternal` instance to emit a connection state change.
`ARTRealtimeChannelInternal` will incorporate some of this data into the `ARTChannelStateChange` object that it emits as a result of the connection state change.
*/
NS_SWIFT_NAME(ChannelStateChangeMetadata)
@interface ARTChannelStateChangeMetadata: NSObject
NS_SWIFT_NAME(ChannelStateChangeParams)
@interface ARTChannelStateChangeParams: NSObject

/**
A state that some operations will use when failing pending presence operations.
Expand All @@ -34,12 +34,12 @@ NS_SWIFT_NAME(ChannelStateChangeMetadata)
- (instancetype)init NS_UNAVAILABLE;

/**
Creates an `ARTChannelStateChangeMetadata` instance whose `errorInfo` is `nil`, and whose `storeErrorInfo` is `NO`.
Creates an `ARTChannelStateChangeParams` instance whose `errorInfo` is `nil`, and whose `storeErrorInfo` is `NO`.
*/
- (instancetype)initWithState:(ARTState)state;

/**
Creates an `ARTChannelStateChangeMetadata` instance with the given `errorInfo`, whose `storeErrorInfo` is `YES`.
Creates an `ARTChannelStateChangeParams` instance with the given `errorInfo`, whose `storeErrorInfo` is `YES`.
*/
- (instancetype)initWithState:(ARTState)state
errorInfo:(nullable ARTErrorInfo *)errorInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
NS_ASSUME_NONNULL_BEGIN

/**
Provides metadata for a request to perform an operation that may cause an `ARTRealtimeInternal` instance to emit a connection state change.
Provides parameters for a request to perform an operation that may cause an `ARTRealtimeInternal` instance to emit a connection state change.
`ARTRealtimeInternal` will incorporate this data into the `ARTConnectionStateChange` object that it emits as a result of the connection state change.
*/
NS_SWIFT_NAME(ConnectionStateChangeMetadata)
@interface ARTConnectionStateChangeMetadata: NSObject
NS_SWIFT_NAME(ConnectionStateChangeParams)
@interface ARTConnectionStateChangeParams: NSObject

/**
Information about the error that triggered this state change, if any.
Expand All @@ -23,7 +23,7 @@ NS_SWIFT_NAME(ConnectionStateChangeMetadata)
@property (assign, nonatomic) BOOL resumed;

/**
Creates an `ARTConnectionStateChangeMetadata` instance whose `errorInfo` is `nil`.
Creates an `ARTConnectionStateChangeParams` instance whose `errorInfo` is `nil`.
*/
- (instancetype)init;

Expand Down
14 changes: 7 additions & 7 deletions Source/PrivateHeaders/Ably/ARTRealtimeChannel+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

@class ARTProtocolMessage;
@class ARTRealtimePresenceInternal;
@class ARTChannelStateChangeMetadata;
@class ARTAttachRequestMetadata;
@class ARTChannelStateChangeParams;
@class ARTAttachRequestParams;

NS_ASSUME_NONNULL_BEGIN

Expand Down Expand Up @@ -51,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN

- (bool)isLastChannelSerial:(NSString *)channelSerial;

- (void)reattachWithMetadata:(ARTAttachRequestMetadata *)metadata;
- (void)reattachWithParams:(ARTAttachRequestParams *)params;

- (void)_attach:(nullable ARTCallback)callback;
- (void)_detach:(nullable ARTCallback)callback;
Expand All @@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN

@interface ARTRealtimeChannelInternal (Private)

- (void)transition:(ARTRealtimeChannelState)state withMetadata:(ARTChannelStateChangeMetadata *)metadata;
- (void)performTransitionToState:(ARTRealtimeChannelState)state withParams:(ARTChannelStateChangeParams *)params;

- (void)onChannelMessage:(ARTProtocolMessage *)message;
- (void)publishProtocolMessage:(ARTProtocolMessage *)pm callback:(ARTStatusCallback)cb;
Expand All @@ -78,12 +78,12 @@ NS_ASSUME_NONNULL_BEGIN
- (void)onSync:(ARTProtocolMessage *)message;
- (void)onError:(ARTProtocolMessage *)error;

- (void)setSuspended:(ARTChannelStateChangeMetadata *)metadata;
- (void)setFailed:(ARTChannelStateChangeMetadata *)metadata;
- (void)setSuspended:(ARTChannelStateChangeParams *)params;
- (void)setFailed:(ARTChannelStateChangeParams *)params;
- (void)throwOnDisconnectedOrFailed;

- (void)broadcastPresence:(ARTPresenceMessage *)pm;
- (void)detachChannel:(ARTChannelStateChangeMetadata *)metadata;
- (void)detachChannel:(ARTChannelStateChangeParams *)params;

- (void)sync;
- (void)sync:(nullable ARTCallback)callback;
Expand Down

0 comments on commit 77cc141

Please sign in to comment.