-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master-erb' into linux
- Loading branch information
Showing
104 changed files
with
1,570 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export class AsyncFunctionQueue { | ||
private readonly queue = new Map<string, Promise<void>>(); | ||
|
||
constructor( | ||
private readonly asyncFunction: (...params: any[]) => Promise<void> | ||
) {} | ||
|
||
async enqueue(...params: any[]): Promise<void> { | ||
const key = params[0]; | ||
|
||
if (this.queue.has(key)) { | ||
const promise = this.queue.get(key); | ||
await promise; | ||
} | ||
|
||
const added = this.asyncFunction(...params); | ||
this.queue.set(key, added); | ||
|
||
try { | ||
await added; | ||
} finally { | ||
this.queue.delete(key); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { NotifyFuseCallback } from './FuseCallback'; | ||
|
||
export class AccessCallback extends NotifyFuseCallback { | ||
constructor() { | ||
super('Access', { input: true, output: true }); | ||
} | ||
|
||
async execute() { | ||
return this.right(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { NotifyFuseCallback } from './FuseCallback'; | ||
|
||
export class ChownCallback extends NotifyFuseCallback { | ||
constructor() { | ||
super('Chown', { input: true, output: true }); | ||
} | ||
|
||
async execute(_path: string, _uid: number, _gid: number) { | ||
return this.right(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.