Skip to content

Commit

Permalink
HexagonShowSync: add docs on upload() return value
Browse files Browse the repository at this point in the history
  • Loading branch information
UweTrottmann committed Nov 13, 2024
1 parent fd66724 commit fdac1e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ class ShowTools2 @Inject constructor(
return !isConnected
}

/**
* Calls [HexagonShowSync.upload].
*/
private suspend fun uploadShowToCloud(show: SgCloudShow): Boolean {
return hexagonShowSync.get().upload(show)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ class HexagonShowSync @Inject constructor(
}

/**
* Uploads the given list of shows to Hexagon.
* Uploads the given list of shows to Hexagon. Returns `true` if upload succeeded.
*/
fun upload(shows: List<SgCloudShow>): Boolean {
if (shows.isEmpty()) {
Expand Down Expand Up @@ -430,6 +430,9 @@ class HexagonShowSync @Inject constructor(
return true
}

/**
* Calls [upload] on the IO dispatcher. Returns `true` if upload succeeded.
*/
suspend fun upload(show: SgCloudShow): Boolean {
return withContext(Dispatchers.IO) {
upload(listOf(show))
Expand Down

0 comments on commit fdac1e5

Please sign in to comment.