chore: post rebase fixes
This commit is contained in:
parent
66838c47e3
commit
f2fa4d7c22
|
|
@ -1,4 +1,3 @@
|
||||||
use crate::{load_env, localhost_client_with_device_id, setup_log};
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
@ -42,7 +41,7 @@ use shared_entity::dto::workspace_dto::{
|
||||||
use shared_entity::response::AppResponseError;
|
use shared_entity::response::AppResponseError;
|
||||||
|
|
||||||
use crate::user::{generate_unique_registered_user, User};
|
use crate::user::{generate_unique_registered_user, User};
|
||||||
use crate::{localhost_client_with_device_id, setup_log};
|
use crate::{load_env, localhost_client_with_device_id, setup_log};
|
||||||
|
|
||||||
pub struct TestClient {
|
pub struct TestClient {
|
||||||
pub user: User,
|
pub user: User,
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
pub struct HttpRealtimeMessage {
|
pub struct HttpRealtimeMessage {
|
||||||
#[prost(string, tag = "1")]
|
#[prost(string, tag = "1")]
|
||||||
pub device_id: ::prost::alloc::string::String,
|
pub device_id: ::prost::alloc::string::String,
|
||||||
#[prost(bytes = "vec", tag = "2")]
|
#[prost(bytes = "vec", tag = "2")]
|
||||||
pub payload: ::prost::alloc::vec::Vec<u8>,
|
pub payload: ::prost::alloc::vec::Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
use collab::core::awareness::AwarenessUpdate;
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use std::fmt::{Debug, Display, Formatter};
|
use std::fmt::{Debug, Display, Formatter};
|
||||||
|
|
||||||
|
use collab::core::awareness::AwarenessUpdate;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
use yrs::updates::decoder::{Decode, Decoder};
|
use yrs::updates::decoder::{Decode, Decoder};
|
||||||
use yrs::updates::encoder::{Encode, Encoder};
|
use yrs::updates::encoder::{Encode, Encoder};
|
||||||
use yrs::StateVector;
|
use yrs::StateVector;
|
||||||
|
|
@ -45,7 +44,7 @@ impl Encode for Message {
|
||||||
},
|
},
|
||||||
Message::Awareness(update) => {
|
Message::Awareness(update) => {
|
||||||
encoder.write_var(MSG_AWARENESS);
|
encoder.write_var(MSG_AWARENESS);
|
||||||
encoder.write_buf(&update.encode_v1())
|
encoder.write_buf(update.encode_v1())
|
||||||
},
|
},
|
||||||
Message::Custom(msg) => {
|
Message::Custom(msg) => {
|
||||||
encoder.write_var(MSG_CUSTOM);
|
encoder.write_var(MSG_CUSTOM);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use crate::error::StreamError;
|
use std::sync::Arc;
|
||||||
use crate::model::{MessageId, StreamBinary, StreamMessage, StreamMessageByStreamKey};
|
use std::time::Duration;
|
||||||
|
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use redis::aio::ConnectionManager;
|
use redis::aio::ConnectionManager;
|
||||||
use redis::streams::{
|
use redis::streams::{
|
||||||
|
|
@ -7,12 +8,12 @@ use redis::streams::{
|
||||||
StreamReadOptions,
|
StreamReadOptions,
|
||||||
};
|
};
|
||||||
use redis::{pipe, AsyncCommands, ErrorKind, RedisResult};
|
use redis::{pipe, AsyncCommands, ErrorKind, RedisResult};
|
||||||
use std::sync::Arc;
|
|
||||||
use std::time::Duration;
|
|
||||||
use tokio_util::sync::CancellationToken;
|
use tokio_util::sync::CancellationToken;
|
||||||
|
|
||||||
use tracing::{error, info, trace, warn};
|
use tracing::{error, info, trace, warn};
|
||||||
|
|
||||||
|
use crate::error::StreamError;
|
||||||
|
use crate::model::{MessageId, StreamBinary, StreamMessage, StreamMessageByStreamKey};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct StreamGroup {
|
pub struct StreamGroup {
|
||||||
connection_manager: ConnectionManager,
|
connection_manager: ConnectionManager,
|
||||||
|
|
@ -219,14 +220,14 @@ impl StreamGroup {
|
||||||
/// Returns the messages that were not consumed yet. Which means each message is delivered to only
|
/// Returns the messages that were not consumed yet. Which means each message is delivered to only
|
||||||
/// one consumer in the group
|
/// one consumer in the group
|
||||||
///
|
///
|
||||||
/// $: This symbol is used with the XREAD command to indicate that you want to start reading only
|
/// `$`: This symbol is used with the XREAD command to indicate that you want to start reading only
|
||||||
/// new messages that arrive in the stream after the read command has been issued. Essentially,
|
/// new messages that arrive in the stream after the read command has been issued. Essentially,
|
||||||
/// it tells Redis to ignore all the messages already in the stream and only listen for new ones.
|
/// it tells Redis to ignore all the messages already in the stream and only listen for new ones.
|
||||||
/// It's particularly useful when you want to start processing messages from the current moment
|
/// It's particularly useful when you want to start processing messages from the current moment
|
||||||
/// forward and don't need to process historical messages.
|
/// forward and don't need to process historical messages.
|
||||||
///
|
///
|
||||||
/// >: This symbol is used with the XREADGROUP command in the context of consumer groups. When a
|
/// `>`: This symbol is used with the XREADGROUP command in the context of consumer groups. When a
|
||||||
/// consumer group reads from a stream using >, it tells Redis to deliver only messages that have
|
/// consumer group reads from a stream using `>`, it tells Redis to deliver only messages that have
|
||||||
/// not yet been acknowledged by any consumer in the group. This allows different consumers in the
|
/// not yet been acknowledged by any consumer in the group. This allows different consumers in the
|
||||||
/// group to read and process different messages concurrently, without receiving messages that have
|
/// group to read and process different messages concurrently, without receiving messages that have
|
||||||
/// already been processed by another consumer. It's a way to distribute the workload of processing
|
/// already been processed by another consumer. It's a way to distribute the workload of processing
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,7 @@ impl CollabMemCache {
|
||||||
/// A `RedisResult<Option<(i64, Vec<u8>)>>` where:
|
/// A `RedisResult<Option<(i64, Vec<u8>)>>` where:
|
||||||
/// - `i64` is the timestamp of the data.
|
/// - `i64` is the timestamp of the data.
|
||||||
/// - `Vec<u8>` is the binary data.
|
/// - `Vec<u8>` is the binary data.
|
||||||
|
///
|
||||||
/// The function returns `Ok(None)` if no data is found for the given `object_id`.
|
/// The function returns `Ok(None)` if no data is found for the given `object_id`.
|
||||||
async fn get_data_with_timestamp(
|
async fn get_data_with_timestamp(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ use collab_entity::CollabType;
|
||||||
use dashmap::DashMap;
|
use dashmap::DashMap;
|
||||||
use futures_util::{SinkExt, StreamExt};
|
use futures_util::{SinkExt, StreamExt};
|
||||||
use tokio::sync::{mpsc, RwLock};
|
use tokio::sync::{mpsc, RwLock};
|
||||||
use tracing::{debug, error, event, trace};
|
use tracing::{error, event, info, trace};
|
||||||
use yrs::updates::decoder::Decode;
|
use yrs::updates::decoder::Decode;
|
||||||
use yrs::updates::encoder::Encode;
|
use yrs::updates::encoder::Encode;
|
||||||
use yrs::Update;
|
use yrs::Update;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ use collab::preclude::Collab;
|
||||||
use collab_document::document::Document;
|
use collab_document::document::Document;
|
||||||
use collab_document::error::DocumentError;
|
use collab_document::error::DocumentError;
|
||||||
use collab_entity::CollabType;
|
use collab_entity::CollabType;
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
use app_error::AppError;
|
use app_error::AppError;
|
||||||
use appflowy_ai_client::client::AppFlowyAIClient;
|
use appflowy_ai_client::client::AppFlowyAIClient;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue