Twitter Network Layer is a scalable and feature rich network layer built on top of NSURLSession for Apple platforms
TNLRequest
class methods with C functions
@interface
have the same name as an @protocol
TNLHTTP.h
to be much more Swift friendlydirect
support for Objective-C code and eliminate PRIVATE_SELF
C function pattern
PRIVATE_SELF
C functions (don't need to check self != nil
)self->_ivar
access in the direct methods (can stick with just using _ivar
)TNLError.h
much more Swift compatibleTNLCommunicationAgent
to handle reachability behavior changes
Network.framwork
can yield an "other" interface when VPN is enabled (on Mac binaries)
Network.framework
used to yield WiFi for any network connection on a simulator, but now yields Wired
TNLNetworkReachabilityReachableViaWiFi
to TNLNetworkReachabilityReachableViaEthernet
and handle both cases as Ethernet
*serviceUnavailableBackoff*
APIs are refactored into *backoff*
APIs[TNLGlobalConfiguration backoffSignaler]
TNLBackoffSignaler
to customize behavior ... or ...TNLSimpleBackoffSignaler
which will signal on HTTP 503
[TNLGlobalConfiguration serviceUnavailableBackoffBehaviorProvider]
for providing a custom backoff behavior
TNLServiceUnavailableBackoffBehaviorProvider
to customize behaviorTNLSimpleServiceUnavailableBackoffBehaviorProvider
TNLURLSessionAuthChallengeCompletionBlock
arguments
NSURLCredentials
to be credentialsOrCancelContext of id
TNLAuthenticationChallengeHandler
instance to be able to cancel the challenge and provide extra context in the resulting error codeNSURLSession
where an HTTP 401 response with WWW-Authenticate
header will always be transparently be retried (even when unmodified yielding the identical 401 response).WWW-Authenticate
header responses to include additional metadata since the response body cannot be used.
FB7697492
TNLRequestOperation
TNLRetryPolicyProvider
would yield a retry, that retry will be delayed by the longer of 2 things:
dependencies
on the TNLRequestOperation
to completedependencies
of a retrying TNLRequestOperation
will be complete before it has started but it is now possible to add dependencies after the request operation has already started to increase the dependencies on a retry starting.tnlcli
, a command-line-interface for TNL
computeMD5
to responseComputeHashAlgorithm
TNLResponse
fully support secure coding
TARGET_OS_UIKITFORMAC
conditional code
TNLRequestOperationQueue
will cancel all request operations for all queues!NSDate
instances
NSDate
now does have the problem of clock changes impacting timings, but this is so infrequent it practically won't ever affect metrics from TNL
sessionId
to TNLAttemptMetaData
NSURLSession
was usedtaskResumePriority
to TNLAttemptMetaData
resume
was called for the underlying NSURLSessionTask
taskResumeLatency
to TNLAttemptMetaData
resume
for the task and the fetching actuallying startingtaskMetricsAfterCompletionLatency
and taskWithoutMetricsCompletionLatency
to TNLAttemptMetaData
#27098270
occurs[TNLGlobalConfiguration URLSessionPruneOptions]
NSURLSession
instances more aggressively than the 12 session limit does[TNLGlobalConfiguration URLSessionInactivityThreshold]
URLSessionPruneOptions
by limiting what NSURLSession
intances are inactive by requiring a duration to elapse since the last network task ran[TNLGlobalConfiguration pruneURLSessionMatchingRequestConfiguration:operationQueueId:]
NSURLSession
based on a given TNLRequestConfiguration
and a TNLRequestOperationQueue
instance's identifier
Author: Laurentiu Dascalu
TNLLogger
to redact desired header fields from being loggedAuthorization
header fieldTNLCommunicationAgent
HTTPBody
HTTPBody
instead of an HTTPFilePath