-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Routing: priority
and mandatory
Router Params
#9083
Comments
priority
and mandatory
Router Paramspriority
and mandatory
Router Params
@ajnavarro : thanks for creating this issue. A few thing:
|
Right now we have the following JSON format for routing configuration: "Routers" : {
"CidContact" : {
"Type" : "reframe",
"Enabled" : true
"Parameters" : {
"Address" : "<URL>"
}
}
} Proposal:
"Routers" : {
"CidContact1" : {
"Type" : "reframe",
"Enabled" : true,
"Mandatory": true,
"Parameters" : {
"Address" : "<URL>"
}
},
"CidContact2" : {
"Type" : "dht",
"Enabled" : false,
"Parameters" : {
"PARAM" : "VAL"
}
}
} Internally, Routers will change from: type Routing struct {
Type *OptionalString `json:",omitempty"`
Routers map[string]Router
}
type Router struct {
Type string
Enabled Flag `json:",omitempty"`
Parameters map[string]string
} To: type Routing struct {
Type *OptionalString `json:",omitempty"`
Routers []Router
}
type Router struct {
Type string
Name string
Enabled Flag `json:",omitempty"`
Mandatory Flag `json:",omitempty"`
Parameters map[string]string
} The major workload here is not in the configuration changes, but in the new behavior that we will need to implement to support ordering and mandatory routers. Right now we are using |
@ajnavarro : thanks for the extra details. A few things on this:
My initial thought is that we either:
OR if that's good enough
|
It matters depending on how we implement the Routers Wrapper. Right now the actual behavior is:
All of these methods are using Context, so we have a timeout to stop the execution if some router is taking too long or we didn't have time to execute all of them.
Maybe we need to define better what means mandatory. For me, mandatory will cause the execution to fail if it fails, but I don't know if it is the best thing to do or if it is useful to the user.
If we need it as a specific value per router, we can add it as a parameter ( I would go with option number 1, keeping things simple, only taking into account that not all methods are running in parallel (should we change actual method behaviors?). Do we know about specific use cases or personas? |
@ajnavarro : sorry not to know. Just for my own learning, can you please link me to the "Routers Wrapper" as it's implemented today? |
Per 2022-08-12 verbal conversation, https://github.com/libp2p/go-libp2p-routing-helpers is what is being referred to here. |
Sorry for the delay @BigLep . We are specifically using https://github.com/libp2p/go-libp2p-routing-helpers/blob/master/tiered.go#L18 |
Superseded by #9157 , #9188 and libp2p/go-libp2p-routing-helpers#56 |
Description
Coming from this discussion: #8997 (comment) we need to figure out if we need and how to add a way to tweak router behavior.
The text was updated successfully, but these errors were encountered: