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

Documentation for session API #184

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

Comments

Projects
None yet
2 participants
@cfjedimaster

cfjedimaster commented Nov 14, 2018

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

This comment has been minimized.

Member

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 Nov 19, 2018

@wafflebot wafflebot bot removed the question label Nov 19, 2018

@cfjedimaster

This comment has been minimized.

cfjedimaster commented Nov 19, 2018

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

This comment has been minimized.

Member

lini commented Nov 19, 2018

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

@cfjedimaster

This comment has been minimized.

cfjedimaster commented Nov 19, 2018

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