refactor: Rename CrossProcessStoreConfig into CrossProcessLockConfig, move it into matrix_sdk_common::cross_process_lock and use it inside CrossProcessLock instead of the previous lock_holder: Option<String>
This commit is contained in:
committed by
Ivan Enderlin
parent
855bdadbad
commit
54e4cb2d10
@@ -3,14 +3,12 @@ use std::{pin::Pin, sync::Arc};
|
||||
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
|
||||
use matrix_sdk::{
|
||||
RoomInfo, RoomState, SqliteEventCacheStore, StateStore,
|
||||
cross_process_lock::CrossProcessLockConfig,
|
||||
store::StoreConfig,
|
||||
sync::{JoinedRoomUpdate, RoomUpdates},
|
||||
test_utils::client::MockClientBuilder,
|
||||
};
|
||||
use matrix_sdk_base::{
|
||||
event_cache::store::{DynEventCacheStore, IntoEventCacheStore, MemoryStore},
|
||||
store::CrossProcessStoreConfig,
|
||||
};
|
||||
use matrix_sdk_base::event_cache::store::{DynEventCacheStore, IntoEventCacheStore, MemoryStore};
|
||||
use matrix_sdk_test::{ALICE, event_factory::EventFactory};
|
||||
use ruma::{
|
||||
EventId, RoomId, event_id,
|
||||
@@ -105,7 +103,7 @@ fn handle_room_updates(c: &mut Criterion) {
|
||||
let client = MockClientBuilder::new(None)
|
||||
.on_builder(|builder| {
|
||||
builder.store_config(
|
||||
StoreConfig::new(CrossProcessStoreConfig::multi_process(
|
||||
StoreConfig::new(CrossProcessLockConfig::multi_process(
|
||||
"cross-process-store-locks-holder-name",
|
||||
))
|
||||
.state_store(state_store.clone())
|
||||
@@ -273,7 +271,7 @@ fn find_event_relations(c: &mut Criterion) {
|
||||
let client = MockClientBuilder::new(None)
|
||||
.on_builder(|builder| {
|
||||
builder.store_config(
|
||||
StoreConfig::new(CrossProcessStoreConfig::multi_process(
|
||||
StoreConfig::new(CrossProcessLockConfig::multi_process(
|
||||
"cross-process-store-locks-holder-name",
|
||||
))
|
||||
.state_store(state_store.clone())
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
|
||||
use matrix_sdk::{store::RoomLoadSettings, test_utils::mocks::MatrixMockServer};
|
||||
use matrix_sdk::{
|
||||
cross_process_lock::CrossProcessLockConfig, store::RoomLoadSettings,
|
||||
test_utils::mocks::MatrixMockServer,
|
||||
};
|
||||
use matrix_sdk_base::{
|
||||
BaseClient, RoomInfo, RoomState, SessionMeta, StateChanges, StateStore, ThreadingSupport,
|
||||
store::{CrossProcessStoreConfig, StoreConfig},
|
||||
store::StoreConfig,
|
||||
};
|
||||
use matrix_sdk_sqlite::SqliteStateStore;
|
||||
use matrix_sdk_test::{JoinedRoomBuilder, event_factory::EventFactory};
|
||||
@@ -57,7 +60,7 @@ pub fn receive_all_members_benchmark(c: &mut Criterion) {
|
||||
.expect("initial filling of sqlite failed");
|
||||
|
||||
let base_client = BaseClient::new(
|
||||
StoreConfig::new(CrossProcessStoreConfig::multi_process(
|
||||
StoreConfig::new(CrossProcessLockConfig::multi_process(
|
||||
"cross-process-store-locks-holder-name",
|
||||
))
|
||||
.state_store(sqlite_store),
|
||||
|
||||
@@ -4,11 +4,9 @@ use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_m
|
||||
use matrix_sdk::{
|
||||
Client, RoomInfo, RoomState, SessionTokens, StateChanges,
|
||||
authentication::matrix::MatrixSession, config::StoreConfig,
|
||||
cross_process_lock::CrossProcessLockConfig,
|
||||
};
|
||||
use matrix_sdk_base::{
|
||||
SessionMeta, StateStore as _,
|
||||
store::{CrossProcessStoreConfig, MemoryStore},
|
||||
};
|
||||
use matrix_sdk_base::{SessionMeta, StateStore as _, store::MemoryStore};
|
||||
use matrix_sdk_sqlite::SqliteStateStore;
|
||||
use ruma::{RoomId, device_id, user_id};
|
||||
use tokio::runtime::Builder;
|
||||
@@ -57,7 +55,7 @@ pub fn restore_session(c: &mut Criterion) {
|
||||
let client = Client::builder()
|
||||
.homeserver_url("https://matrix.example.com")
|
||||
.store_config(
|
||||
StoreConfig::new(CrossProcessStoreConfig::multi_process(
|
||||
StoreConfig::new(CrossProcessLockConfig::multi_process(
|
||||
"cross-process-store-locks-holder-name",
|
||||
))
|
||||
.state_store(store.clone()),
|
||||
@@ -89,7 +87,7 @@ pub fn restore_session(c: &mut Criterion) {
|
||||
let client = Client::builder()
|
||||
.homeserver_url("https://matrix.example.com")
|
||||
.store_config(
|
||||
StoreConfig::new(CrossProcessStoreConfig::multi_process(
|
||||
StoreConfig::new(CrossProcessLockConfig::multi_process(
|
||||
"cross-process-store-locks-holder-name",
|
||||
))
|
||||
.state_store(store.clone()),
|
||||
|
||||
Reference in New Issue
Block a user