feat: allow failable service creation in streamable HTTP tower service (#244)
* feat: allow failable service creation in streamable HTTP tower service In our setup we need to lookup some info that may fail before we serve the request. * Fix examples build
This commit is contained in:
parent
c4f252a21d
commit
73188eff6f
2 changed files with 12 additions and 8 deletions
|
|
@ -12,7 +12,7 @@ use rmcp::transport::streamable_http_server::{
|
|||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
let service = TowerToHyperService::new(StreamableHttpService::new(
|
||||
Counter::new,
|
||||
|| Ok(Counter::new()),
|
||||
LocalSessionManager::default().into(),
|
||||
Default::default(),
|
||||
));
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ async fn main() -> anyhow::Result<()> {
|
|||
.init();
|
||||
|
||||
let service = StreamableHttpService::new(
|
||||
Counter::new,
|
||||
|| Ok(Counter::new()),
|
||||
LocalSessionManager::default().into(),
|
||||
Default::default(),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue