Chuyển đến nội dung
Skillpedia
Lập trình chung48k · #5641

robius-app-architecture

Skill này làm gì

Skill này giúp tổ chức code cho các ứng dụng được xây bằng công cụ Makepad, đặc biệt là những ứng dụng cần xử lý các tác vụ tốn thời gian (bất đồng bộ). Nó hướng dẫn cách cấu trúc ứng dụng để giao diện người dùng luôn phản hồi nhanh.

Khi nào nên dùng

  • ✓Khi bạn xây dựng một ứng dụng Makepad kết nối với máy chủ.
  • ✓Khi bạn lên kế hoạch cách các phần khác nhau của ứng dụng giao tiếp với nhau.
  • ✓Khi bạn làm theo các ví dụ từ ứng dụng như Robrix hoặc Moly.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/robius-app-architecture/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/robius-app-architecture/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm sao để tổ chức ứng dụng Makepad của tôi để xử lý các yêu cầu mạng một cách hiệu quả?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill định nghĩa một mẫu trong đó giao diện người dùng gửi yêu cầu đến một khu vực xử lý chạy nền (dùng channel và Tokio). Khu vực này thực hiện các tác vụ tốn thời gian và gửi kết quả về giao diện để cập nhật.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Supporting material availability

This catalog copy contains the inline guidance below, but does not include the following supporting paths. They are external prerequisites, not bundled files:

  • <support-root>/references/tokio-integration.md
  • <support-root>/references/channel-patterns.md
  • <support-root>/references/moly-async-patterns.md

Ask for the original supporting material or an existing installation before using a step that depends on these paths; this catalog does not identify a verified download source for them. Resolve each path relative to that installation, inspect its contents, and verify any applicable license and execution prerequisites. Do not run a command or claim a referenced procedure was followed until its required file exists. Do not fabricate the missing scripts or treat an unrelated file with the same name as equivalent. Independent steps fully documented here can proceed within the user’s authorized scope; report any dependent step as unavailable.

Robius App Architecture Skill

Best practices for structuring Makepad applications based on the Robrix and Moly codebases - production applications built with Makepad and Robius framework.

Source codebases:

  • Robrix: Matrix chat client - complex sync/async with background subscriptions
  • Moly: AI chat application - cross-platform (native + WASM) with streaming APIs

When to Use

Use this skill when:

  • Building a Makepad application with async backend integration
  • Designing sync/async communication patterns in Makepad
  • Structuring a Robius-style application
  • Keywords: robrix, robius, makepad app structure, async makepad, tokio makepad

Production Patterns

For production-ready async patterns, see the _base/ directory:

Pattern Description
08-async-loading Async data loading with loading states
09-streaming-results Incremental results with SignalToUI
13-tokio-integration Full tokio runtime integration

Core Architecture Pattern

┌─────────────────────────────────────────────────────────────┐
│                     UI Thread (Makepad)                     │
│  ┌─────────┐     ┌──────────┐     ┌──────────────────────┐ │
│  │   App   │────▶│ WidgetRef │────▶│ Widget Tree (View)  │ │
│  │ State   │     │    ui     │     │ Scope::with_data()  │ │
│  └────┬────┘     └──────────┘     └──────────────────────┘ │
│       │                                                     │
│       │ submit_async_request()                              │
│       ▼                                                     │
│  ┌─────────────────┐          ┌─────────────────────────┐  │
│  │ REQUEST_SENDER  │─────────▶│  Crossbeam SegQueue     │  │
│  │ (MPSC Channel)  │          │  (Lock-free Updates)    │  │
│  └─────────────────┘          └─────────────────────────┘  │
└───────────────────────────────────┬─────────────────────────┘
                                    │
                    SignalToUI::set_ui_signal()
                                    │
┌───────────────────────────────────┴─────────────────────────┐
│                   Tokio Runtime (Async)                      │
│  ┌──────────────────────────────────────────────────────┐   │
│  │           worker_task (Request Handler)               │   │
│  │  - Receives Request from UI                           │   │
│  │  - Spawns async tasks per request                     │   │
│  │  - Posts actions back via Cx::post_action()           │   │
│  └──────────────────────────────────────────────────────┘   │
│  ┌──────────────────────────────────────────────────────┐   │
│  │         Per-Item Subscriber Tasks                     │   │
│  │  - Listens to external data stream                    │   │
│  │  - Sends Update via crossbeam channel                 │   │
│  │  - Calls SignalToUI::set_ui_signal() to wake UI       │   │
│  └──────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────┘

App Structure

Top-Level App Definition

use makepad_widgets::*;

live_design! {
    use link::theme::*;
    use link::widgets::*;

    App = {{App}} {
        ui: <Root>{
            main_window = <Window> {
                window: {inner_size: vec2(1280, 800), title: "MyApp"},
                body = {
                    // Main content here
                }
            }
        }
    }
}

app_main!(App);

#[derive(Live)]
pub struct App {
    #[live] ui: WidgetRef,

…
Câu hỏi thường gặp

Tác vụ bất đồng bộ là gì?

Đó là các tác vụ mà chương trình có thể bắt đầu rồi tiếp tục làm việc khác trong lúc chờ kết quả, thay vì bị đứng yên khi chờ.

Makepad là gì?

Đó là công cụ tạo giao diện người dùng cho ứng dụng, tập trung vào hiệu năng và khả năng chạy đa nền tảng.

Vì sao giao diện người dùng cần luôn phản hồi?

Để người dùng có thể tiếp tục thao tác với ứng dụng (nhấn nút, cuộn trang) trong khi các tác vụ dài hơn đang được xử lý ở chế độ nền.

Chi tiết

Mô tả gốc của tác giả

CRITICAL: Use for Robius app architecture patterns. Triggers on: Tokio, async, submit_async_request, 异步, 架构, SignalToUI, Cx::post_action, worker task, app structure, MatchEvent, handle_startup

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5641
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự