FBSDKGraphRequestQueue.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. */
  8. #import <Foundation/Foundation.h>
  9. #import <FBSDKCoreKit/FBSDKGraphRequest.h>
  10. #import <FBSDKCoreKit/FBSDKGraphRequestMetadata.h>
  11. NS_ASSUME_NONNULL_BEGIN
  12. /**
  13. The `FBSDKGraphRequestQueue` allows for several graph requests to be queued
  14. for later execution as a batch request.
  15. */
  16. NS_SWIFT_NAME(GraphRequestQueue)
  17. @interface FBSDKGraphRequestQueue : NSObject
  18. /**
  19. Gets the shared instance `FBSDKGraphRequestQueue` singleton
  20. */
  21. + (instancetype)sharedInstance;
  22. + (instancetype)new NS_UNAVAILABLE;
  23. - (instancetype)init NS_UNAVAILABLE;
  24. - (void)configureWithGraphRequestConnectionFactory:(id<FBSDKGraphRequestConnectionFactory>)graphRequestConnectionFactory
  25. NS_SWIFT_NAME(configure(graphRequestConnectionFactory:));
  26. /**
  27. @method
  28. This method adds an <FBSDKGraphRequest> with its completion handler into the queue.
  29. @param request The request to be queued
  30. @param completion A handler to call back when the request is executed.
  31. */
  32. - (void)enqueueRequest:(id<FBSDKGraphRequest>)request
  33. completion:(FBSDKGraphRequestCompletion)completion;
  34. /**
  35. Internal method exposed to facilitate transition to Swift.
  36. API Subject to change or removal without warning. Do not use.
  37. @warning INTERNAL - DO NOT USE
  38. */
  39. - (void)enqueueRequests:(NSArray<FBSDKGraphRequestMetadata *> *)requests;
  40. /**
  41. Internal method exposed to facilitate transition to Swift.
  42. API Subject to change or removal without warning. Do not use.
  43. @warning INTERNAL - DO NOT USE
  44. */
  45. - (void)enqueueRequestMetadata:(FBSDKGraphRequestMetadata *)requestMetadata;
  46. /**
  47. @method
  48. This method flushes the queue. All requests currently in the queue will be
  49. executed in a single batch request. The queue is then emptied.
  50. */
  51. - (void)flush;
  52. @end
  53. NS_ASSUME_NONNULL_END