fix: release Dever 0.1.6 with shared runtime assets and unbounded workers
This commit is contained in:
1 parent
a900d7e8db
commit
5589b657db
17 files changed
+357
-49
No files matched your search
@@ -33,7 +33,7 @@ pub struct Definition {
|
||||
pub capabilities: Vec<String>,
|
||||
pub operations: Vec<String>,
|
||||
pub setting: Option<String>,
|
||||
pub timeout_ms: u64,
|
||||
pub protocol_timeout_ms: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -318,7 +318,7 @@ fn validate_definition(definition: &Definition) -> Result<(), String> {
|
||||
|| definition.adapter.is_empty()
|
||||
|| definition.schema.is_empty()
|
||||
|| definition.operations.is_empty()
|
||||
|| definition.timeout_ms == 0
|
||||
|| definition.protocol_timeout_ms == 0
|
||||
{
|
||||
return Err("incomplete external Adapter definition".into());
|
||||
}
|
||||
@@ -468,10 +468,8 @@ async fn protocol_session(
|
||||
let _ = request.response.send(Err("external Adapter worker stopped".into()));
|
||||
return Err("external Adapter worker stopped while writing a call".into());
|
||||
}
|
||||
result = write_frame_timeout(input, &message, Duration::from_millis(definition.timeout_ms)) => result?,
|
||||
result = write_frame_timeout(input, &message, Duration::from_millis(definition.protocol_timeout_ms)) => result?,
|
||||
}
|
||||
let timeout = tokio::time::sleep(Duration::from_millis(definition.timeout_ms));
|
||||
tokio::pin!(timeout);
|
||||
let result = tokio::select! {
|
||||
biased;
|
||||
_ = &mut *stopping => {
|
||||
@@ -484,11 +482,6 @@ async fn protocol_session(
|
||||
cancel_request(input, output, id).await?;
|
||||
continue;
|
||||
}
|
||||
_ = &mut timeout => {
|
||||
let _ = request.response.send(Err("external Adapter call timed out".into()));
|
||||
cancel_request(input, output, id).await?;
|
||||
continue;
|
||||
}
|
||||
};
|
||||
match result {
|
||||
Ok(reply) => {
|
||||
@@ -564,7 +557,7 @@ async fn handshake(
|
||||
input: &mut ChildStdin,
|
||||
output: &mut ChildStdout,
|
||||
) -> Result<(), String> {
|
||||
let timeout = Duration::from_millis(definition.timeout_ms);
|
||||
let timeout = Duration::from_millis(definition.protocol_timeout_ms);
|
||||
write_frame_timeout(input, &hello_message(definition)?, timeout).await?;
|
||||
let ready = read_frame_timeout(output, timeout).await?;
|
||||
validate_ready(definition, &ready)?;
|
||||
|
||||
Reference in new issue
Block a user