-
Notifications
You must be signed in to change notification settings - Fork 12
Schedule command delivering, update version to 0.3
#123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Current coverage is
|
|
@alexander-yevsyukov, PTAL. |
| Namespace namespace = 5; | ||
|
|
||
| oneof time_opts { | ||
| // The delay to wait before sending the command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The delay after which moment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the current time.
Conflicts: client/src/main/java/org/spine3/base/Commands.java client/src/test/java/org/spine3/base/CommandsShould.java examples/build.gradle server/src/main/java/org/spine3/server/command/CommandBus.java
add a builder to CommandBus.
|
@alexander-yevsyukov, PTAL. |
|
|
||
| // The time when the command should be sent. | ||
| google.protobuf.Timestamp sending_time = 7; | ||
| // The time when the command should be delivered to the target. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The delivery time depends on the path a command goes after it is posted to CommandBus. There could be one or more dispatchers in between, for example. The load time for an aggregate may be unpredictable, etc.
So, in general, we won't be able to guarantee the delivery by the time specified. It would be too complex. What we can promise is that we'd post the command to the CommandBus shortly after the time specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about just after?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, so I'm removing delivery_time for now.
|
@alexander-yevsyukov, PTAL. |
| // This flag is needed to specify that a scheduled command arrived in time, and to retain the scheduling options. | ||
| bool in_time = 3; | ||
| // This flag is needed to specify that the delay is passed, and to retain the info about the delay. | ||
| bool ignore_delay = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is still confusing. Why cannot we have a set of already scheduled command IDs? If a command posted is already scheduled, it would mean that we need to execute it.
|
PTAL. |
|
|
||
| assertCommandSent(cmd, DELAY); | ||
| assertNull(postedCommand); | ||
| sleep(DELAY_MS + CHECK_OFFSET_MS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test it using spy() or mock(). Sleeping threads does not scale well for testing.
|
PTAL. |
Conflicts: server/src/main/java/org/spine3/server/command/CommandBus.java server/src/test/java/org/spine3/server/BoundedContextShould.java server/src/test/java/org/spine3/server/BoundedContextTestStubs.java server/src/test/java/org/spine3/server/command/CommandBusShould.java
Conflicts: server/src/main/java/org/spine3/server/command/CommandBus.java
| /** | ||
| * Utility class for working with durations in addition to those available from {@link TimeUtil}. | ||
| * | ||
| * <p/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the excessive paragraph tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make IDEA stop adding these nasty tags?
| grpc { | ||
| // option 'nano=true' | ||
| } | ||
| grpc {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the empty grpc block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do. Adding even empty closure in this section adds protoc option --%CLOSURE_NAME%_out. In our case, this empty block is a signal to generate grpc services
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
values/build.gradle
Outdated
| grpc { | ||
| // option 'nano=true' | ||
| } | ||
| grpc {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the empty grpc section here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Killed.
Conflicts: client/src/main/java/org/spine3/base/Responses.java server/src/main/java/org/spine3/server/command/CommandBus.java server/src/main/java/org/spine3/server/reflect/MethodMap.java server/src/test/java/org/spine3/server/BoundedContextShould.java server/src/test/java/org/spine3/server/BoundedContextTestStubs.java server/src/test/java/org/spine3/server/command/CommandBusShould.java values/build.gradle
|
PTAL. |
|
Please use |
|
Other than that, LGTM |
0.3
Also updated version to 0.3.