3030 * This implementation of FileProcessingWorkflow downloads the file, zips it, and uploads it to a
3131 * destination. An important requirement for such a workflow is that while a first activity can run
3232 * on any host, the second and third must run on the same host as the first one. This is achieved
33- * through use of a host specific task list . The first activity returns the name of the host
34- * specific task list and all other activities are dispatched using the stub that is configured with
35- * it. This assumes that FileProcessingWorker has a worker running on the same task list .
33+ * through use of a host specific task queue . The first activity returns the name of the host
34+ * specific task queue and all other activities are dispatched using the stub that is configured
35+ * with it. This assumes that FileProcessingWorker has a worker running on the same task queue .
3636 */
3737public class FileProcessingWorkflowImpl implements FileProcessingWorkflow {
3838
39- // Uses the default task list shared by the pool of workers.
40- private final StoreActivities defaultTaskListStore ;
39+ // Uses the default task queue shared by the pool of workers.
40+ private final StoreActivities defaultTaskQueueStore ;
4141
4242 public FileProcessingWorkflowImpl () {
4343 // Create activity clients.
4444 ActivityOptions ao =
4545 ActivityOptions .newBuilder ()
4646 .setScheduleToCloseTimeout (Duration .ofSeconds (10 ))
47- .setTaskList (FileProcessingWorker .TASK_LIST )
47+ .setTaskQueue (FileProcessingWorker .TASK_QUEUE )
4848 .build ();
49- this .defaultTaskListStore = Workflow .newActivityStub (StoreActivities .class , ao );
49+ this .defaultTaskQueueStore = Workflow .newActivityStub (StoreActivities .class , ao );
5050 }
5151
5252 @ Override
@@ -61,19 +61,19 @@ public void processFile(URL source, URL destination) {
6161 }
6262
6363 private void processFileImpl (URL source , URL destination ) {
64- StoreActivities .TaskListFileNamePair downloaded = defaultTaskListStore .download (source );
64+ StoreActivities .TaskQueueFileNamePair downloaded = defaultTaskQueueStore .download (source );
6565
66- // Now initialize stubs that are specific to the returned task list .
66+ // Now initialize stubs that are specific to the returned task queue .
6767 ActivityOptions hostActivityOptions =
6868 ActivityOptions .newBuilder ()
69- .setTaskList (downloaded .getHostTaskList ())
69+ .setTaskQueue (downloaded .getHostTaskQueue ())
7070 .setScheduleToCloseTimeout (Duration .ofSeconds (10 ))
7171 .build ();
7272 StoreActivities hostSpecificStore =
7373 Workflow .newActivityStub (StoreActivities .class , hostActivityOptions );
7474
7575 // Call processFile activity to zip the file.
76- // Call the activity to process the file using worker-specific task list .
76+ // Call the activity to process the file using worker-specific task queue .
7777 String processed = hostSpecificStore .process (downloaded .getFileName ());
7878 // Call upload activity to upload the zipped file.
7979 hostSpecificStore .upload (processed , destination );
0 commit comments