Package google.registry.batch
Class CloudTasksUtils
java.lang.Object
google.registry.batch.CloudTasksUtils
- All Implemented Interfaces:
Serializable
Utilities for dealing with Cloud Tasks.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Constructor Summary
ConstructorDescriptionCloudTasksUtils
(Retrier retrier, Clock clock, String projectId, String locationId, String oauthClientId, GoogleCredentialsBundle credential, CloudTasksUtils.SerializableCloudTasksClient client) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.cloud.tasks.v2.Task
createGetTask
(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params) com.google.cloud.tasks.v2.Task
createGetTaskWithDelay
(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params, org.joda.time.Duration delay) Create aTask
via HTTP.GET that will be delayed fordelay
.com.google.cloud.tasks.v2.Task
createGetTaskWithJitter
(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params, Optional<Integer> jitterSeconds) Create aTask
via HTTP.GET that will be randomly delayed up tojitterSeconds
.com.google.cloud.tasks.v2.Task
createPostTask
(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params) com.google.cloud.tasks.v2.Task
createPostTaskWithDelay
(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params, org.joda.time.Duration delay) Create aTask
via HTTP.POST that will be delayed fordelay
.com.google.cloud.tasks.v2.Task
createPostTaskWithJitter
(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params, Optional<Integer> jitterSeconds) Create aTask
via HTTP.POST that will be randomly delayed up tojitterSeconds
.com.google.cloud.tasks.v2.Task
com.google.common.collect.ImmutableList
<com.google.cloud.tasks.v2.Task> com.google.common.collect.ImmutableList
<com.google.cloud.tasks.v2.Task>
-
Constructor Details
-
CloudTasksUtils
@Inject public CloudTasksUtils(Retrier retrier, Clock clock, @Config("projectId") String projectId, @Config("locationId") String locationId, @Config("oauthClientId") String oauthClientId, @ApplicationDefaultCredential GoogleCredentialsBundle credential, CloudTasksUtils.SerializableCloudTasksClient client)
-
-
Method Details
-
enqueue
-
enqueue
-
enqueue
public com.google.common.collect.ImmutableList<com.google.cloud.tasks.v2.Task> enqueue(String queue, com.google.cloud.tasks.v2.Task... tasks) -
createPostTask
public com.google.cloud.tasks.v2.Task createPostTask(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params) -
createGetTask
public com.google.cloud.tasks.v2.Task createGetTask(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params) -
createPostTaskWithJitter
public com.google.cloud.tasks.v2.Task createPostTaskWithJitter(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params, Optional<Integer> jitterSeconds) Create aTask
via HTTP.POST that will be randomly delayed up tojitterSeconds
. -
createGetTaskWithJitter
public com.google.cloud.tasks.v2.Task createGetTaskWithJitter(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params, Optional<Integer> jitterSeconds) Create aTask
via HTTP.GET that will be randomly delayed up tojitterSeconds
. -
createPostTaskWithDelay
public com.google.cloud.tasks.v2.Task createPostTaskWithDelay(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params, org.joda.time.Duration delay) Create aTask
via HTTP.POST that will be delayed fordelay
. -
createGetTaskWithDelay
public com.google.cloud.tasks.v2.Task createGetTaskWithDelay(String path, Action.Service service, com.google.common.collect.Multimap<String, String> params, org.joda.time.Duration delay) Create aTask
via HTTP.GET that will be delayed fordelay
.
-