Skip to content

Commit

Permalink
Move concurrentSubscriptionPool property to MTRDeviceController_Concr…
Browse files Browse the repository at this point in the history
…ete. (project-chip#36328)

The non-concrete case does not directly create subscriptions, so has no need of
a pool for them.
  • Loading branch information
bzbarsky-apple authored Oct 31, 2024
1 parent d93f3f6 commit e5ae065
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
7 changes: 7 additions & 0 deletions src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#import <Matter/MTRDeviceStorageBehaviorConfiguration.h>
#import <Matter/MTROTAProviderDelegate.h>

#import "MTRAsyncWorkQueue.h"
#import "MTRDeviceConnectionBridge.h"
#import "MTRDeviceControllerStartupParams_Internal.h"

Expand Down Expand Up @@ -226,6 +227,12 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (readonly) chip::FabricIndex fabricIndex;

/**
* A queue with a fixed width that allows a number of MTRDevice objects to perform
* subscription at the same time.
*/
@property (nonatomic, readonly) MTRAsyncWorkQueue<MTRDeviceController *> * concurrentSubscriptionPool;

@end

NS_ASSUME_NONNULL_END
2 changes: 0 additions & 2 deletions src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ @interface MTRDeviceController_Concrete ()
@property (nonatomic, readonly, nullable) MTRAttestationTrustStoreBridge * attestationTrustStoreBridge;
@property (nonatomic, readonly, nullable) NSMutableArray<MTRServerEndpoint *> * serverEndpoints;

@property (nonatomic, readonly) MTRAsyncWorkQueue<MTRDeviceController *> * concurrentSubscriptionPool;

@property (nonatomic, readonly) MTRDeviceStorageBehaviorConfiguration * storageBehaviorConfiguration;

// Whether we should be advertising our operational identity when we are not suspended.
Expand Down
7 changes: 0 additions & 7 deletions src/darwin/Framework/CHIP/MTRDeviceController_Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
@class MTRDeviceControllerParameters;
@class MTRDeviceControllerFactory;
@class MTRDevice;
@class MTRAsyncWorkQueue;
@protocol MTRDevicePairingDelegate;
@protocol MTRDeviceControllerDelegate;
@class MTRDevice_Concrete;
Expand Down Expand Up @@ -78,12 +77,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, readonly, nullable) id<MTROTAProviderDelegate> otaProviderDelegate;
@property (nonatomic, readonly, nullable) dispatch_queue_t otaProviderDelegateQueue;

/**
* A queue with a fixed width that allows a number of MTRDevice objects to perform
* subscription at the same time.
*/
@property (nonatomic, readonly) MTRAsyncWorkQueue<MTRDeviceController *> * concurrentSubscriptionPool;

/**
* Fabric ID tied to controller
*/
Expand Down
2 changes: 1 addition & 1 deletion src/darwin/Framework/CHIP/MTRDevice_Concrete.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ - (void)_scheduleSubscriptionPoolWork:(dispatch_block_t)workBlock inNanoseconds:

workBlock();
}];
[self->_deviceController.concurrentSubscriptionPool enqueueWorkItem:workItem description:description];
[[[self _concreteController] concurrentSubscriptionPool] enqueueWorkItem:workItem description:description];
MTR_LOG("%@ - enqueued in the subscription pool", self);
};

Expand Down

0 comments on commit e5ae065

Please sign in to comment.