酷店

TBSDKServerQueue.h 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // '########'########::'######:'########:'##:::'##:
  2. // ... ##..::##.... ##'##... ##:##.... ##:##::'##::
  3. // ::: ##::::##:::: ##:##:::..::##:::: ##:##:'##:::
  4. // ::: ##::::########:. ######::##:::: ##:#####::::
  5. // ::: ##::::##.... ##:..... ##:##:::: ##:##. ##:::
  6. // ::: ##::::##:::: ##'##::: ##:##:::: ##:##:. ##::
  7. // ::: ##::::########:. ######::########::##::. ##:
  8. // :::..::::........:::......::........::..::::..::
  9. //
  10. // Created by 亿刀/禚来强 on 13-1-28.
  11. // Copyright (c) 2013年 Taobao. All rights reserved.
  12. //
  13. #import <Foundation/Foundation.h>
  14. /** TBSDK的请求池。
  15. *
  16. * TBSDK的请求池,是单例模式。保存了TBSDK的所有的网络请求
  17. * 用户可以获取获取自己的网络请求,而不需要将网络请求保存为实例变量
  18. */
  19. @interface TBSDKServerQueue : NSObject
  20. + (TBSDKServerQueue *)shareInstance;
  21. //! 获取delegate_对应的符合TBSDKRequestQueueProtocol协议的对象。
  22. - (NSArray *)getRequestForDelegate:(id)delegate_;
  23. //! 退出符合TBSDKRequestQueueProtocol协议的对象的网络请求,并把符合TBSDKRequestQueueProtocol协议的对象的delegate设置为nil。
  24. - (void)cancelRequestNetworkAndClearDelegateForDelegate:(id)delegate_;
  25. @end
  26. @protocol TBSDKRequestQueueProtocol <NSObject>
  27. @required
  28. - (void)clearDelegatesAndCancel;
  29. @optional
  30. @property (nonatomic, weak) id delegate;
  31. @end