• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

temporalio / sdk-java / #244

10 Apr 2024 08:19PM UTC coverage: 77.465% (-0.08%) from 77.549%
#244

push

github

web-flow
Slot supplier interface & fixed-size implementation (#2014)

https://github.com/temporalio/proposals/blob/master/all-sdk/autotuning.md

286 of 388 new or added lines in 25 files covered. (73.71%)

3 existing lines in 3 files now uncovered.

19116 of 24677 relevant lines covered (77.46%)

0.77 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/temporal-sdk/src/main/java/io/temporal/internal/worker/EagerActivityDispatcher.java
1
/*
2
 * Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved.
3
 *
4
 * Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
 *
6
 * Modifications copyright (C) 2017 Uber Technologies, Inc.
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this material except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 *   http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and
18
 * limitations under the License.
19
 */
20

21
package io.temporal.internal.worker;
22

23
import io.temporal.api.command.v1.ScheduleActivityTaskCommandAttributesOrBuilder;
24
import io.temporal.api.workflowservice.v1.PollActivityTaskQueueResponse;
25
import io.temporal.worker.tuning.SlotPermit;
26
import java.util.Optional;
27

28
public interface EagerActivityDispatcher {
29
  Optional<SlotPermit> tryReserveActivitySlot(
30
      ScheduleActivityTaskCommandAttributesOrBuilder commandAttributes);
31

32
  void releaseActivitySlotReservations(Iterable<SlotPermit> permits);
33

34
  void dispatchActivity(PollActivityTaskQueueResponse activity, SlotPermit permit);
35

36
  class NoopEagerActivityDispatcher implements EagerActivityDispatcher {
1✔
37
    @Override
38
    public Optional<SlotPermit> tryReserveActivitySlot(
39
        ScheduleActivityTaskCommandAttributesOrBuilder commandAttributes) {
40
      return Optional.empty();
1✔
41
    }
42

43
    @Override
44
    public void releaseActivitySlotReservations(Iterable<SlotPermit> permits) {
45
      if (permits.iterator().hasNext())
1✔
UNCOV
46
        throw new IllegalStateException(
×
47
            "Trying to release activity slots on a NoopEagerActivityDispatcher");
48
    }
1✔
49

50
    @Override
51
    public void dispatchActivity(PollActivityTaskQueueResponse activity, SlotPermit permit) {
52
      throw new IllegalStateException(
×
53
          "Trying to dispatch activity on a NoopEagerActivityDispatcher");
54
    }
55
  }
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc