[swift5] Reuse URLSessions#10790
Conversation
|
@davidhorvath Hey, first of all, thanks for this contribution. |
8e66f2b to
8ab1480
Compare
8ab1480 to
f6eaca4
Compare
|
@4brunu I've just updated my PR with the asked changes |
|
@davidhorvath thanks for making the changes, I left some comments |
52c5d2e to
d2e001d
Compare
|
@4brunu Thanks for the review! I've fixed your comments |
|
@davidhorvath Thanks for your help fixing this issue. |
|
@davidhorvath I have tested this on my local project and it seems that everything is working. |
@4brunu I haven't tested the latest version in our project yet but I will later today. |
|
@4brunu |
|
Nice, thanks for your help 😊 |
@4brunu Thanks for your support |
resolve #8562
Creating new URLSession for every request isn't optimal and it is not recommended by Apple.
Also,
NSPOSIXErrorDomain Code=28 "No space left on device"will get thrown after too many URLSessions get created.I've hashed the session's configuration, credentials and sessionDelegate with Hasher so we can reuse URLSessions with the same settings.
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(5.3.0),6.0.x