Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
While working on #1066 and the integration tests for the
roles, I noticed a few technical debts that would need to be addressed in a future refactor:** Note that the goal of this issue is to document the different problems within the roles code, but we are not planning to resolve them until we are done with #845.
The following points are related almost always to all of the roles:
Problem:
async-channelis used withintokiocontext which can result in an unexpected bugsSolution: use
tokiochannels https://tokio.rs/tokio/tutorial/channelsProblem: Some struct(s) function(s) have weird signatures like
self_: &Arc<Mutex<Self>>Solution: Wrap only the properties that need to be mutated in a
MutexProblem: An internal
Muteximplementation is usedSolution: use https://docs.rs/tokio/latest/tokio/sync/struct.Mutex.html instead
Problem: Duplicate code between the different roles. Some roles need
Downstreamservice, others needUpstream. Usually this is just a server.Solution: use a common definition for
Upstream,Downstreamacross theroleswhere possibleProblem: Config properties are not clear and not grouped in structs
Solution: Group properties into structs with more clear names
Problem: Roles have more responsibilities than needed. For example the
poolrole is required to connect to theTemplateProviderinstead of receiving theTemplateProviderconnection as an input.Solution: Minimize code inside
role::startfunctions across the different roles to only do whats that role is responsible for.Beta Was this translation helpful? Give feedback.
All reactions