Skip to content

Commit

Permalink
add tags to turbo tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Apr 24, 2024
1 parent ce8e28a commit 758adfc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion crates/turbo-tasks-fetch/src/lib.rs
Expand Up @@ -46,7 +46,7 @@ pub enum ProxyConfig {
#[turbo_tasks::value(transparent)]
pub struct OptionProxyConfig(Option<ProxyConfig>);

#[turbo_tasks::function]
#[turbo_tasks::function(network)]
pub async fn fetch(
url: Vc<String>,
user_agent: Vc<Option<String>>,
Expand Down
12 changes: 6 additions & 6 deletions crates/turbo-tasks-fs/src/attach.rs
Expand Up @@ -121,17 +121,17 @@ impl AttachedFileSystem {

#[turbo_tasks::value_impl]
impl FileSystem for AttachedFileSystem {
#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
fn read(self: Vc<Self>, path: Vc<FileSystemPath>) -> Vc<FileContent> {
self.get_inner_fs_path(path).read()
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
fn read_link(self: Vc<Self>, path: Vc<FileSystemPath>) -> Vc<LinkContent> {
self.get_inner_fs_path(path).read_link()
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
async fn read_dir(self: Vc<Self>, path: Vc<FileSystemPath>) -> Result<Vc<DirectoryContent>> {
let dir_content = self.get_inner_fs_path(path).read_dir().await?;
let entries = match &*dir_content {
Expand All @@ -157,17 +157,17 @@ impl FileSystem for AttachedFileSystem {
Ok(DirectoryContent::new(converted_entries))
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
fn track(self: Vc<Self>, path: Vc<FileSystemPath>) -> Vc<Completion> {
self.get_inner_fs_path(path).track()
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
fn write(self: Vc<Self>, path: Vc<FileSystemPath>, content: Vc<FileContent>) -> Vc<Completion> {
self.get_inner_fs_path(path).write(content)
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
fn write_link(
self: Vc<Self>,
path: Vc<FileSystemPath>,
Expand Down
14 changes: 7 additions & 7 deletions crates/turbo-tasks-fs/src/lib.rs
Expand Up @@ -320,7 +320,7 @@ impl Debug for DiskFileSystem {

#[turbo_tasks::value_impl]
impl FileSystem for DiskFileSystem {
#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
async fn read(&self, fs_path: Vc<FileSystemPath>) -> Result<Vc<FileContent>> {
let full_path = self.to_sys_path(fs_path).await?;
self.register_invalidator(&full_path)?;
Expand All @@ -344,7 +344,7 @@ impl FileSystem for DiskFileSystem {
Ok(content.cell())
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
async fn read_dir(&self, fs_path: Vc<FileSystemPath>) -> Result<Vc<DirectoryContent>> {
let full_path = self.to_sys_path(fs_path).await?;
self.register_dir_invalidator(&full_path)?;
Expand Down Expand Up @@ -403,7 +403,7 @@ impl FileSystem for DiskFileSystem {
Ok(DirectoryContent::new(entries))
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
async fn read_link(&self, fs_path: Vc<FileSystemPath>) -> Result<Vc<LinkContent>> {
let full_path = self.to_sys_path(fs_path).await?;
self.register_invalidator(&full_path)?;
Expand Down Expand Up @@ -491,14 +491,14 @@ impl FileSystem for DiskFileSystem {
.cell())
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
async fn track(&self, fs_path: Vc<FileSystemPath>) -> Result<Vc<Completion>> {
let full_path = self.to_sys_path(fs_path).await?;
self.register_invalidator(&full_path)?;
Ok(Completion::new())
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
async fn write(
&self,
fs_path: Vc<FileSystemPath>,
Expand Down Expand Up @@ -612,7 +612,7 @@ impl FileSystem for DiskFileSystem {
Ok(Completion::new())
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
async fn write_link(
&self,
fs_path: Vc<FileSystemPath>,
Expand Down Expand Up @@ -699,7 +699,7 @@ impl FileSystem for DiskFileSystem {
Ok(Completion::new())
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
async fn metadata(&self, fs_path: Vc<FileSystemPath>) -> Result<Vc<FileMeta>> {
let full_path = self.to_sys_path(fs_path).await?;
self.register_invalidator(&full_path)?;
Expand Down
4 changes: 2 additions & 2 deletions crates/turbo-tasks-fs/src/read_glob.rs
Expand Up @@ -16,7 +16,7 @@ pub struct ReadGlobResult {
///
/// DETERMINISM: Result is in random order. Either sort result or do not depend
/// on the order.
#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
pub async fn read_glob(
directory: Vc<FileSystemPath>,
glob: Vc<Glob>,
Expand All @@ -25,7 +25,7 @@ pub async fn read_glob(
read_glob_internal("", directory, glob, include_dot_files).await
}

#[turbo_tasks::function]
#[turbo_tasks::function(fs)]
async fn read_glob_inner(
prefix: String,
directory: Vc<FileSystemPath>,
Expand Down

0 comments on commit 758adfc

Please sign in to comment.