Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 893fbe8

Browse files
committed
arcify data
1 parent c121bf0 commit 893fbe8

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

apps/nextra/next.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,12 @@ export default withBundleAnalyzer(
441441
"/en/build/indexer/indexer-sdk/documentation/version-tracking",
442442
permanent: true,
443443
},
444+
{
445+
source: "/indexer/indexer-sdk/documentation/arcify-data",
446+
destination:
447+
"/en/build/indexer/indexer-sdk/documentation/arcify-data",
448+
permanent: true,
449+
},
444450
{
445451
source: "/indexer/indexer-sdk/documentation/run-processor",
446452
destination:

apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/_meta.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ export default {
1818
"version-tracking": {
1919
title: "Version Tracking",
2020
},
21+
"arcify-data": {
22+
title: "Arcifying Data",
23+
},
2124
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: "Arcifying Step"
3+
---
4+
5+
# Overview
6+
7+
The `ArcifyStep` is a utility step in the processing pipeline that transforms owned data into reference-counted `Arc` instances. This is particularly useful when the data needs to be shared across multiple components or threads without unnecessary cloning.
8+
9+
## Key Responsibilities
10+
11+
1. **Convert to `Arc`**: Converts a vector of owned items into a vector of `Arc`-wrapped items.
12+
2. **Preserve Metadata**: Maintains the transaction context metadata during transformation.
13+
14+
## How It Works
15+
16+
- The `ArcifyStep` takes a `TransactionContext` containing a vector of owned items.
17+
- Each item in the vector is wrapped in an `Arc` to enable efficient sharing.
18+
- The metadata from the original context is preserved in the output.
19+
20+
## Example Usage
21+
22+
### Converting Data to `Arc`
23+
24+
```rust
25+
let mut arcify_step = ArcifyStep::new();
26+
let input_context = TransactionContext {
27+
data: vec![1, 2, 3],
28+
metadata: TransactionMetadata {
29+
start_version: 0,
30+
end_version: 0,
31+
start_transaction_timestamp: None,
32+
end_transaction_timestamp: None,
33+
total_size_in_bytes: 0,
34+
},
35+
};
36+
37+
let result = arcify_step.process(input_context).await.unwrap().unwrap();
38+
assert_eq!(*result.data[0], 1);
39+
```
40+

0 commit comments

Comments
 (0)