MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / handle_async_ans

Function handle_async_ans

chirpstack/src/api/backend/mod.rs:602–625  ·  view source on GitHub ↗
(bp: &BasePayload, b: &[u8])

Source from the content-addressed store, hash-verified

600}
601
602async fn handle_async_ans(bp: &BasePayload, b: &[u8]) -> Result<Response> {
603 let transaction_id = bp.transaction_id;
604
605 let key = redis_key(format!("backend:async:{}", transaction_id));
606
607 () = redis::pipe()
608 .atomic()
609 .cmd("XADD")
610 .arg(&key)
611 .arg("MAXLEN")
612 .arg(1_i64)
613 .arg("*")
614 .arg("pl")
615 .arg(b)
616 .ignore()
617 .cmd("EXPIRE")
618 .arg(&key)
619 .arg(30_i64)
620 .ignore()
621 .query_async(&mut get_async_redis_conn().await?)
622 .await?;
623
624 Ok((StatusCode::OK, "").into_response())
625}
626
627pub async fn get_async_receiver(
628 transaction_id: u32,

Callers 2

_handle_requestFunction · 0.85
test_async_responseFunction · 0.85

Calls 2

redis_keyFunction · 0.85
get_async_redis_connFunction · 0.85

Tested by 1

test_async_responseFunction · 0.68