@peerbit/native-backbone 0.2.9 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -20
- package/dist/src/index.d.ts +61 -8
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +948 -74
- package/dist/src/index.js.map +1 -1
- package/dist/wasm/README.md +55 -20
- package/dist/wasm/native_backbone.d.ts +124 -79
- package/dist/wasm/native_backbone.js +297 -0
- package/dist/wasm/native_backbone_bg.wasm +0 -0
- package/dist/wasm/native_backbone_bg.wasm.d.ts +90 -79
- package/package.json +2 -2
- package/src/append_tx/committed_latest.rs +10 -5
- package/src/append_tx/committed_no_next.rs +6 -3
- package/src/append_tx/facts.rs +427 -1
- package/src/append_tx/mod.rs +51 -18
- package/src/append_tx/storage.rs +12 -2
- package/src/index.ts +1418 -227
- package/src/shared_log_plan.rs +30 -0
package/src/shared_log_plan.rs
CHANGED
|
@@ -391,6 +391,36 @@ impl NativePeerbitBackbone {
|
|
|
391
391
|
.full_replica_candidates_for(min_replicas, self_hash)
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
+
#[allow(clippy::too_many_arguments)]
|
|
395
|
+
pub fn get_routing_full_replica_leaders(
|
|
396
|
+
&self,
|
|
397
|
+
replicas: usize,
|
|
398
|
+
role_age_ms: f64,
|
|
399
|
+
now: String,
|
|
400
|
+
peer_filter: JsValue,
|
|
401
|
+
expand_peer_filter: bool,
|
|
402
|
+
self_hash: String,
|
|
403
|
+
include_self: bool,
|
|
404
|
+
full_replica_fallback: bool,
|
|
405
|
+
include_strict_full_replica: bool,
|
|
406
|
+
) -> Result<JsValue, JsValue> {
|
|
407
|
+
let leaders = self
|
|
408
|
+
.shared_log
|
|
409
|
+
.plan_routing_full_replica_leaders_core(
|
|
410
|
+
replicas,
|
|
411
|
+
role_age_ms,
|
|
412
|
+
&now,
|
|
413
|
+
peer_filter,
|
|
414
|
+
expand_peer_filter,
|
|
415
|
+
&self_hash,
|
|
416
|
+
include_self,
|
|
417
|
+
full_replica_fallback,
|
|
418
|
+
include_strict_full_replica,
|
|
419
|
+
)
|
|
420
|
+
.map_err(JsValue::from)?;
|
|
421
|
+
Ok(leader_samples_to_optional_rows(&leaders))
|
|
422
|
+
}
|
|
423
|
+
|
|
394
424
|
#[allow(clippy::too_many_arguments)]
|
|
395
425
|
pub fn put_range(
|
|
396
426
|
&mut self,
|