• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Doing request rate limiting with NSURLSession
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Doing request rate limiting with NSURLSession


  • Subject: Re: Doing request rate limiting with NSURLSession
  • From: Sebastien Boisvert <email@hidden>
  • Date: Fri, 22 Feb 2019 16:56:12 -0500

That's more-or-less what we ended up doing, but implemented it as a custom
NSURLProtocol that can be used by a session's configuration (so it can be used
with any session, or subclassed to handle specific endpoints, etc.). When using
it one thing to keep in mind was to ensure the timeout for the session (or the
tasks themselves) was long enough so they didn't get cancelled before the
protocol got to handling them.


> On Oct 10, 2018, at 1:37 PM, Jens Alfke <email@hidden> wrote:
>
> You can queue the requests yourself in an NSMutableArray or something. Then
> issue the first one. When the task's delegate’s didSendBodyData: method is
> called, schedule starting the next request (either immediately or after a
> delay of ≤ 1/32 sec.)
>
> This is a bit conservative because that delegate method won’t be called until
> some time after the HTTP request is sent, but it should keep you from getting
> errors.
>
> —Jens

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Waking up AWDL
  • Next by Date: Re: Waking up AWDL
  • Previous by thread: Re: Waking up AWDL
  • Next by thread: NSURLDelegate: Differences between access by hostname or IP
  • Index(es):
    • Date
    • Thread