Skip to content

Conversation

@AlexanderLitus
Copy link
Contributor

@AlexanderLitus AlexanderLitus commented Apr 7, 2016

Also updated version to 0.3.

@codecov-io
Copy link

Current coverage is 83.46%

Merging #123 into master will increase coverage by +1.37% as of 18b425e

@@            master    #123   diff @@
======================================
  Files           95      97     +2
  Stmts         2692    2794   +102
  Branches       318     331    +13
  Methods                          
======================================
+ Hit           2210    2332   +122
- Partial         79      81     +2
+ Missed         403     381    -22

Review entire Coverage Diff as of 18b425e

Powered by Codecov. Updated on successful CI builds.

@AlexanderLitus
Copy link
Contributor Author

@alexander-yevsyukov, PTAL.

Namespace namespace = 5;

oneof time_opts {
// The delay to wait before sending the command.
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the current time.

Alexander Litus added 2 commits April 8, 2016 10:49
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
@AlexanderLitus
Copy link
Contributor Author

@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.
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just after?

Copy link
Contributor Author

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.

@AlexanderLitus
Copy link
Contributor Author

@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;
Copy link
Contributor

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.

@AlexanderLitus
Copy link
Contributor Author

PTAL.


assertCommandSent(cmd, DELAY);
assertNull(postedCommand);
sleep(DELAY_MS + CHECK_OFFSET_MS);
Copy link
Contributor

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.

@AlexanderLitus
Copy link
Contributor Author

PTAL.

Alexander Litus added 5 commits April 19, 2016 13:33
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/>
Copy link
Contributor

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.

Copy link
Contributor

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 {}
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep.

grpc {
// option 'nano=true'
}
grpc {}
Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Killed.

Alexander Litus added 3 commits April 19, 2016 18:33
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
@AlexanderLitus
Copy link
Contributor Author

PTAL.

@alexander-yevsyukov
Copy link
Contributor

Please use times(1) instead of atMost(1) in tests. The change seems to be lost in recent merges.

@alexander-yevsyukov
Copy link
Contributor

Other than that, LGTM

@AlexanderLitus AlexanderLitus merged commit 1e19970 into master Apr 20, 2016
@AlexanderLitus AlexanderLitus deleted the schedule-commands branch April 20, 2016 09:03
@AlexanderLitus AlexanderLitus changed the title Schedule command delivering Schedule command delivering, update version to 0.3 Jun 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants