Skip to content

Documentation for session API #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cfjedimaster opened this issue Nov 14, 2018 · 4 comments
Closed

Documentation for session API #184

cfjedimaster opened this issue Nov 14, 2018 · 4 comments
Labels

Comments

@cfjedimaster
Copy link

Looking at the readme and I see this line repeated a few times:

var session = bghttp.session("image-upload");

However, I do not see this documented. My assumption is that:

  • Each time you do an HTTP call, you will use a new session.
  • The name of the session ... is what? Used for descriptive purposes? Must it be unique?

Basically, can you add documentation for what session() means?

@lini
Copy link
Contributor

lini commented Nov 16, 2018

Documenting exactly what the session constructor does is a tricky subject, since the internal implementation for Android and iOS is very different. For Android it is only used to keep track of the active sessions and to stop an upload in progress. For iOS it is passed to the native NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier method which returns a native object with the session config.

To answer your questions: each session must have a unique identifier, but you can create more than one task and upload multiple files (at the same time) using one session. The demo applications in this repo can be used to test this behavior.

@lini lini closed this as completed Nov 19, 2018
@ghost ghost removed the question label Nov 19, 2018
@cfjedimaster
Copy link
Author

I think that's fair (that it is difficult to answer), but even this text here was helpful. I see it's closed - can it be reopened and added to the readme?

@lini
Copy link
Contributor

lini commented Nov 19, 2018

Sorry, I closed the issue because the docs have already been updated and the information has been added.

@cfjedimaster
Copy link
Author

Ah sorry - didn't see - thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants