• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vortex-data / vortex / 16935267080

13 Aug 2025 11:00AM UTC coverage: 24.312% (-63.3%) from 87.658%
16935267080

Pull #4226

github

web-flow
Merge 81b48c7fb into baa6ea202
Pull Request #4226: Support converting TimestampTZ to and from duckdb

0 of 2 new or added lines in 1 file covered. (0.0%)

20666 existing lines in 469 files now uncovered.

8726 of 35892 relevant lines covered (24.31%)

147.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/vortex-layout/src/executor.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright the Vortex contributors
3

4
use std::sync::Arc;
5

6
use futures::FutureExt;
7
use futures::channel::oneshot;
8
use futures::future::BoxFuture;
9
use vortex_error::{VortexResult, vortex_err};
10

11
pub trait TaskExecutor: 'static + Send + Sync {
12
    fn do_spawn(
13
        &self,
14
        fut: BoxFuture<'static, VortexResult<()>>,
15
    ) -> BoxFuture<'static, VortexResult<()>>;
16
}
17

18
impl<T: TaskExecutor> TaskExecutor for Arc<T> {
19
    fn do_spawn(
×
20
        &self,
×
21
        fut: BoxFuture<'static, VortexResult<()>>,
×
22
    ) -> BoxFuture<'static, VortexResult<()>> {
×
23
        self.as_ref().do_spawn(fut)
×
24
    }
×
25
}
26

27
pub trait TaskExecutorExt: TaskExecutor {
28
    fn spawn<T: 'static + Send>(
29
        &self,
30
        fut: BoxFuture<'static, VortexResult<T>>,
31
    ) -> BoxFuture<'static, VortexResult<T>>;
32
}
33

34
impl<E: TaskExecutor + ?Sized> TaskExecutorExt for E {
35
    fn spawn<T: 'static + Send>(
12✔
36
        &self,
12✔
37
        fut: BoxFuture<'static, VortexResult<T>>,
12✔
38
    ) -> BoxFuture<'static, VortexResult<T>> {
12✔
39
        let (send, recv) = oneshot::channel::<VortexResult<T>>();
12✔
40
        let fut = self.do_spawn(
12✔
41
            async move {
12✔
42
                let result = fut.await;
12✔
43
                send.send(result)
12✔
44
                    .map_err(|_| vortex_err!("Failed to send result"))
12✔
45
            }
12✔
46
            .boxed(),
12✔
47
        );
48

49
        Box::pin(async move {
12✔
50
            fut.await?;
12✔
51
            recv.await
12✔
52
                .map_err(|canceled| vortex_err!("Spawned task canceled {}", canceled))
12✔
53
                .flatten()
12✔
54
        })
12✔
55
    }
12✔
56
}
57

58
#[cfg(feature = "tokio")]
59
impl TaskExecutor for tokio::runtime::Handle {
UNCOV
60
    fn do_spawn(
×
UNCOV
61
        &self,
×
UNCOV
62
        f: BoxFuture<'static, VortexResult<()>>,
×
UNCOV
63
    ) -> BoxFuture<'static, VortexResult<()>> {
×
64
        use futures::TryFutureExt;
65
        use tracing::Instrument;
66

UNCOV
67
        tokio::runtime::Handle::spawn(self, f.in_current_span())
×
UNCOV
68
            .map_err(vortex_error::VortexError::from)
×
UNCOV
69
            .map(|result| result.flatten())
×
UNCOV
70
            .boxed()
×
UNCOV
71
    }
×
72
}
73

74
pub struct LocalExecutor;
75

76
impl TaskExecutor for LocalExecutor {
77
    fn do_spawn(
12✔
78
        &self,
12✔
79
        fut: BoxFuture<'static, VortexResult<()>>,
12✔
80
    ) -> BoxFuture<'static, VortexResult<()>> {
12✔
81
        fut
12✔
82
    }
12✔
83
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc