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

vortex-data / vortex / 16505110840

24 Jul 2025 06:40PM UTC coverage: 81.498% (+0.04%) from 81.457%
16505110840

push

github

web-flow
Remove scan async API (#4005)

Signed-off-by: Nicholas Gates <nick@nickgates.com>

150 of 222 new or added lines in 10 files covered. (67.57%)

10 existing lines in 2 files now uncovered.

42586 of 52254 relevant lines covered (81.5%)

172411.37 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::{ResultExt, 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>(
7,489✔
36
        &self,
7,489✔
37
        fut: BoxFuture<'static, VortexResult<T>>,
7,489✔
38
    ) -> BoxFuture<'static, VortexResult<T>> {
7,489✔
39
        let (send, recv) = oneshot::channel::<VortexResult<T>>();
7,489✔
40
        let fut = self.do_spawn(
7,489✔
41
            async move {
7,489✔
42
                let result = fut.await;
7,489✔
43
                send.send(result)
7,489✔
44
                    .map_err(|_| vortex_err!("Failed to send result"))
7,489✔
45
            }
7,489✔
46
            .boxed(),
7,489✔
47
        );
48

49
        Box::pin(async move {
7,489✔
50
            fut.await?;
7,489✔
51
            recv.await
7,489✔
52
                .map_err(|canceled| vortex_err!("Spawned task canceled {}", canceled))
7,489✔
53
                .unnest()
7,489✔
54
        })
7,489✔
55
    }
7,489✔
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.unnest())
×
UNCOV
70
            .boxed()
×
UNCOV
71
    }
×
72
}
73

74
pub struct LocalExecutor;
75

76
impl TaskExecutor for LocalExecutor {
77
    fn do_spawn(
7,489✔
78
        &self,
7,489✔
79
        fut: BoxFuture<'static, VortexResult<()>>,
7,489✔
80
    ) -> BoxFuture<'static, VortexResult<()>> {
7,489✔
81
        fut
7,489✔
82
    }
7,489✔
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