Skip to content

Commit 49bd0aa

Browse files
ellenevansdpebot
authored andcommitted
Add region tags (#1012)
* Add region tags One for create task and one for lease and acknowledge task * Update PullQueue.java Updated comment markers * Update PullQueue.java Changed indents on comments
1 parent 3784ac3 commit 49bd0aa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cloud-tasks/src/main/java/com.example.cloudtasks/PullQueue.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ private static CloudTasks createAuthorizedClient() throws IOException {
6565
.build();
6666
}
6767

68+
// [START cloud_tasks_create_task]
6869
/**
6970
* Create a task for a given queue with a given payload.
7071
*/
@@ -96,7 +97,10 @@ private static Task createTask(
9697
System.out.println(String.format("Created task %s",task.getName()));
9798
return result;
9899
}
99-
100+
// [END cloud_tasks_create_task]
101+
102+
103+
// [START cloud_tasks_lease_and_acknowledge_task]
100104
/**
101105
* Pull a single task from a given queue and lease it for 10 minutes.
102106
*/
@@ -144,6 +148,7 @@ private static void acknowledgeTask(Task task) throws IOException {
144148
.execute();
145149
System.out.println(String.format("Acknowledged task %s", task.getName()));
146150
}
151+
// [END cloud_tasks_lease_and_acknowledge_task]
147152

148153
public static void main(String[] args) throws Exception {
149154
ArgumentParser parser = ArgumentParsers.newFor("PullQueue").build()
@@ -206,4 +211,4 @@ public static void main(String[] args) throws Exception {
206211
}
207212
}
208213

209-
}
214+
}

0 commit comments

Comments
 (0)