Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private static CloudTasks createAuthorizedClient() throws IOException {
.build();
}

# [START cloud_tasks_create_task]
/**
* Create a task for a given queue with a given payload.
*/
Expand Down Expand Up @@ -96,7 +97,10 @@ private static Task createTask(
System.out.println(String.format("Created task %s",task.getName()));
return result;
}

# [END cloud_tasks_create_task]


# [START cloud_tasks_lease_and_acknowledge_task]
/**
* Pull a single task from a given queue and lease it for 10 minutes.
*/
Expand Down Expand Up @@ -144,6 +148,7 @@ private static void acknowledgeTask(Task task) throws IOException {
.execute();
System.out.println(String.format("Acknowledged task %s", task.getName()));
}
# [END cloud_tasks_lease_and_acknowledge_task]

public static void main(String[] args) throws Exception {
ArgumentParser parser = ArgumentParsers.newFor("PullQueue").build()
Expand Down Expand Up @@ -206,4 +211,4 @@ public static void main(String[] args) throws Exception {
}
}

}
}