actions-on-google / actions-on-google-java

Java/Kotlin library for Actions on Google
Apache License 2.0
286 stars 39 forks source link

Close channel after getting a response #53

Open 2m opened 4 years ago

2m commented 4 years ago

This fixes the following errors from the logs:

Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.

This fix was originally mentioned in https://github.com/actions-on-google/actions-on-google-java/issues/30#issuecomment-529400776

I have also published this change to my bintray repository so I can use this fix in https://github.com/actions-on-google/smart-home-java

If anyone else is interested, you can also use it by adding the following to the gradle build:

repositories {
  maven {
    url 'http://dl.bintray.com/2m/maven'
  }
}

dependencies {
  implementation 'com.google.actions:actions-on-google:1.8.0-2m'
}
Fleker commented 4 years ago

@proppy can you evaluate this?

proppy commented 4 years ago

As mentioned in https://github.com/actions-on-google/actions-on-google-java/issues/30#issuecomment-644234766, I think we should consider tying the lifecycle of the channel to SmartHomeApp.

Should we split the fix to CONTRIBUTING.md in a separate pull request?

2m commented 4 years ago

Sounds good. I will split changes to CONTRIBUTING.md to a separate PR and also will rework this PR so the lifecycle of the channel is tied to SmartHomeApp.

proppy commented 4 years ago

@2m just a related note that we are also considering removing this homegraph wrapper altogether in favor of having developer depends directly on the generated homegraph bindings: https://github.com/googleapis/google-api-java-client-services/tree/master/clients/google-api-services-homegraph/v1

I'd be curious to hear your thoughts.

EgHubs commented 2 years ago

looks like the link of bintray is unavailable

 > Could not resolve com.google.actions:actions-on-google:1.8.0-2m.
         > Could not get resource 'http://dl.bintray.com/2m/maven/com/google/actions/actions-on-google/1.8.0-2m/actions-on-google-1.8.0-2m.pom'.
            > Could not GET 'http://dl.bintray.com/2m/maven/com/google/actions/actions-on-google/1.8.0-2m/actions-on-google-1.8.0-2m.pom'.
               > dl.bintray.com:80 failed to respond

I added like described in the build Gradle file

repositories {
  maven {
    url 'http://dl.bintray.com/2m/maven'
  }
  mavenCentral()
  jcenter()
}
dependencies {
  implementation 'com.google.actions:actions-on-google:1.8.0-2m'
}

Anyway, where can I edit that SmartHomeApp.kt file, I can't find it anywhere Screen Shot 2022-04-28 at 2 00 52 AM

2m commented 2 years ago

looks like the link of bintray is unavailable

Yea, bintray was shutdown since then.

I stopped working on this PR since I am not using this project anymore in my home automation.

Feel free to take it over.