Skip to content

Commit

Permalink
Removed WAT
Browse files Browse the repository at this point in the history
  • Loading branch information
daihaminkey committed Mar 24, 2023
1 parent d8ff140 commit c368b82
Show file tree
Hide file tree
Showing 129 changed files with 46 additions and 6,444 deletions.
90 changes: 45 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,50 @@ using Fractural.Tasks;

public Test : Node
{
public override _Ready()
{
// Running a task from a non-async method
Run().Forget();
}

public async GDTaskVoid Run()
{
await GDTask.DelayFrame(100);

// waiting some amount of time
await GDTask.Delay(TimeSpan.FromSeconds(10));

// Waiting a single frame
await GDTask.Yield();
await GDTask.NextFrame();
await GDTask.WaitForEndOfFrame();

// Waiting for specific lifetime call
await GDTask.WaitForPhysicsProcess();

// Cancellation
var cts = new CancellationTokenSource();
CancellableReallyLongTask(cts.Token).Forget();
await GDTask.Delay(TimeSpan.FromSeconds(3));
cts.Cancel();

// Async await with return value
string result = await RunWithResult();
return result + " with additional text";
}

public async GDTask<string> RunWithResult()
{
await GDTask.Delay(TimeSpan.FromSeconds(3));
return "A result string";
}

public async GDTaskVoid ReallyLongTask(CancellationToken cancellationToken)
{
GD.Print("Starting long task.");
await GDTask.Delay(TimeSpan.FromSeconds(1000000), cancellationToken: cancellationToken);
GD.Print("Finished long task.");
}
public override _Ready()
{
// Running a task from a non-async method
Run().Forget();
}

public async GDTaskVoid Run()
{
await GDTask.DelayFrame(100);

// waiting some amount of time
await GDTask.Delay(TimeSpan.FromSeconds(10));

// Waiting a single frame
await GDTask.Yield();
await GDTask.NextFrame();
await GDTask.WaitForEndOfFrame();

// Waiting for specific lifetime call
await GDTask.WaitForPhysicsProcess();

// Cancellation
var cts = new CancellationTokenSource();
CancellableReallyLongTask(cts.Token).Forget();
await GDTask.Delay(TimeSpan.FromSeconds(3));
cts.Cancel();

// Async await with return value
string result = await RunWithResult();
return result + " with additional text";
}

public async GDTask<string> RunWithResult()
{
await GDTask.Delay(TimeSpan.FromSeconds(3));
return "A result string";
}

public async GDTaskVoid ReallyLongTask(CancellationToken cancellationToken)
{
GD.Print("Starting long task.");
await GDTask.Delay(TimeSpan.FromSeconds(1000000), cancellationToken: cancellationToken);
GD.Print("Finished long task.");
}
}
```

Expand All @@ -73,4 +73,4 @@ Git Submodules
git submodule add -b release https://github.com/fractural/GDTask.git addons/GDTask
```

3. Add `addons/GDTask/Autoload/GDTaskPlayerLoopAutoload` as an autoload
3. Add `addons/GDTask/Autoload/GDTaskPlayerLoopAutoload` as an autoload
21 changes: 0 additions & 21 deletions addons/WAT/LICENSE

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

73 changes: 0 additions & 73 deletions addons/WAT/assertions/assertion.gd

This file was deleted.

Loading

0 comments on commit c368b82

Please sign in to comment.