Get a metadata and a channel that can be used to append to a webhook source.
(
&self,
database: String,
schema: String,
name: String,
)
| 526 | |
| 527 | /// Get a metadata and a channel that can be used to append to a webhook source. |
| 528 | pub async fn get_webhook_appender( |
| 529 | &self, |
| 530 | database: String, |
| 531 | schema: String, |
| 532 | name: String, |
| 533 | ) -> Result<AppendWebhookResponse, AppendWebhookError> { |
| 534 | let (tx, rx) = oneshot::channel(); |
| 535 | |
| 536 | // Send our request. |
| 537 | self.send(Command::GetWebhook { |
| 538 | database, |
| 539 | schema, |
| 540 | name, |
| 541 | tx, |
| 542 | }); |
| 543 | |
| 544 | // Using our one shot channel to get the result, returning an error if the sender dropped. |
| 545 | let response = rx |
| 546 | .await |
| 547 | .map_err(|_| anyhow::anyhow!("failed to receive webhook response"))?; |
| 548 | |
| 549 | response |
| 550 | } |
| 551 | |
| 552 | /// Gets the current value of all system variables. |
| 553 | pub async fn get_system_vars(&self) -> SystemVars { |
no test coverage detected