-
Notifications
You must be signed in to change notification settings - Fork 155
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
Adding tx with built-in retries support for RxSession #582
Conversation
968dba7
to
dbce261
Compare
…ssion and all tx are built on top of ExplictTx.
Added more IT for tx run with retries.
3f75a13
to
ee20288
Compare
By default, Project Reactor schedules delayed operations on a parallel scheduler, which is created lazily when needed. We can avoid creating such an extra resource by schedule the delayed work on our existing netty event loop thread pool. This behaviour is exactly the same as our existing async retries. Added tests to verify that the Parallel scheduler is not created.
… not used correctly.
ee20288
to
a8b0306
Compare
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.
LGTM.
I had one naming suggestion against the internal classes.
import org.neo4j.driver.internal.cursor.RxStatementResultCursor; | ||
import org.neo4j.driver.internal.spi.Connection; | ||
|
||
public interface ExplicitTransaction |
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.
I slightly got confused with the new naming scheme. Since both NetworkSession
and ExplicitTransaction
are core building blocks for the rest of the surfaced API, what do you think about renaming ExplicitTransaction
to NetworkTransaction
- just to form a relationship between the two?
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 name NetworkTransaction
dose not fits the Transaction very much. Will it be more clear if I remove the interfaces and directly call the implementations NetworkSession
and ExplicitTransaction
?
Then all sessions will be built on top of NetworkSession
and all transactions are built on top of ExplicitTransaction
.
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.
👍 I think that would help.
…ion`. And put implementation directly instead.
Implemented
RxSession#readTransaction
andRxSession#writeTransaction
usingFlux#retryWhen
.Extracted
NetworkSession
to provide basicrunAsync
andrunRx
methods, allowing other session implementations (such as AsyncSession, RxSession) build on top of it.