MCPcopy Create free account
hub / github.com/astercloud/aster / main

Function main

examples/long-running-tools/main.go:16–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14)
15
16func main() {
17 ctx := context.Background()
18
19 // ====== 示例 1: 基础异步执行 ======
20 fmt.Println("=== Example 1: Basic Async Execution ===")
21 basicAsyncExample(ctx)
22
23 // ====== 示例 2: 进度跟踪 ======
24 fmt.Println("\n=== Example 2: Progress Tracking ===")
25 progressTrackingExample(ctx)
26
27 // ====== 示例 3: 任务取消 ======
28 fmt.Println("\n=== Example 3: Task Cancellation ===")
29 cancellationExample(ctx)
30
31 // ====== 示例 4: 并发多任务 ======
32 fmt.Println("\n=== Example 4: Concurrent Tasks ===")
33 concurrentTasksExample(ctx)
34
35 // ====== 示例 5: 任务清理 ======
36 fmt.Println("\n=== Example 5: Task Cleanup ===")
37 cleanupExample(ctx)
38
39 fmt.Println("\n✅ All examples completed!")
40}
41
42// basicAsyncExample 基础异步执行示例
43func basicAsyncExample(ctx context.Context) {

Callers

nothing calls this directly

Calls 5

basicAsyncExampleFunction · 0.85
progressTrackingExampleFunction · 0.85
cancellationExampleFunction · 0.85
concurrentTasksExampleFunction · 0.85
cleanupExampleFunction · 0.85

Tested by

no test coverage detected