Skill站外收录 @skilllib/skill-2014279395177869315
understanding-flow
提供 walkerOS 事件处理的架构理解能力,围绕 Source→Collector→Destination 模式展开,支持多源接入、动态路由、分阶段转换及多目标投递,强调组件解耦、可替换性与端到端数据流编排。
软件开发 AI 技能
Skills.MD
# Understanding walkerOS Flow
## Overview
walkerOS follows a **Source → Collector → Destination(s)** architecture for
composable, modular event processing.
**Core principle:** Separation of concerns. Each component has one job.
Components are composable and replaceable.
## The Flow Pattern
```
Sources → [Pre-Transformers] → Collector → [Post-Transformers] → Destinations
(Capture) (source.next) (Processing) (dest.before) (Delivery)
- Browser DOM - Validation - Validation - Google Analytics
- DataLayer - Enrichment - Enrichment - Meta Pixel
- Server HTTP - Redaction - Consent check - Custom API
- Cloud Functions - Routing - Data Warehouse
```
## Key Concepts
### Composability
A Flow combines components. You can:
- Use multiple sources feeding one collector
- Route events to multiple destinations
- Swap components without changing others
### The Flow Type
See [packages/core/src/types/flow.ts](../../packages/core/src/types/flow.ts) for
the canonical interface.
```typescript
// Conceptual structure (see source for full type)
interface Flow {
sources?: Record<string, Source>;
collector: Collector;
destinations?: Record<string, Destination>;
}
```
### Universal Push Interface
**All components communicate via `push` functions:**
| Component | Push Signature | Purpose |
| ----------- | ----------------------------- | --------------------- |
| Source | `push(input) → events` | Capture external data |
| Collector | `push(event) → void` | Process and route |
| Destination | `push(event, context) → void` | Transform and deliver |
The `elb()` function is an alias for `collector.push` - used for component
wiring.
### startFlow Helper
See [packages/collector/src/flow.ts](../../packages/collector/src/flow.ts) for
the `startFlow` function.
```typescript
import { startFlow } from '@walkeros/collector';
const { collector, elb } = await startFlow({
sources: {
/* ... */
},
destinations: {
/* ... */
},
});
```
## Separation of Concerns
| Concern | Handled By | NOT Handled By |
| ---------------- | -------------- | ----------------------- |
| Event capture | Sources | Collector, Destinations |
| Event structure | Event model | Components |
| Consent checking | Collector | Sources, Destinations |
| Transformation | Mapping system | Raw push calls |
| Delivery | Destinations | Sources, Collector |
## Transformer Chains
Transformers run at two points in the pipeline, configured via `next` and
`before`:
### Pre-Collector Chain
Runs after source captures event, before collector processing:
```typescript
sources: {
browser: {
code: sourceBrowser,
next: 'validate' // First transformer in pre-chain
}
},
transformers: {
validate: {
code: transformerValidator,
config: { next: 'enrich' } // Chain continues
},
enrich: {
code: transformerEnrich
// No next = chain ends, event goes to collector
}
}
```
### Post-Collector Chain
Runs after collector enrichment, before destination receives event:
```typescript
destinations: {
gtag: {
code: destinationGtag,
before: 'redact' // First transformer in post-chain
}
},
transformers: {
redact: {
code: transformerRedact
// Event then goes to destination
}
}
```
### Chain Resolution
- `source.next` → starts pre-collector chain
- `transformer.config.next` → links transformers together
- `destination.before` → starts post-collector chain per destination
## Related
**Skills:**
- [understanding-events skill](../understanding-events/SKILL.md) - Event model
- [understanding-transformers skill](../understanding-transformers/SKILL.md) -
Transformer interface and chaining
- [understanding-destinations skill](../understanding-destinations/SKILL.md) -
Destination interface
- [understanding-sources skill](../understanding-sources/SKILL.md) - Source
interface
**Package READMEs:**
- [packages/collector/README.md](../../packages/collector/README.md) - Collector
details
**Source Files:**
- [packages/collector/src/flow.ts](../../packages/collector/src/flow.ts) -
startFlow implementation
**Documentation:**
- [Website: Flow](../../website/docs/getting-started/flow.mdx) - Flow concept
- [Website: Collector](../../website/docs/collector/index.mdx) - Collector docs
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「understanding-flow」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次