feat: basic ffi server to support other languages (#34)

* wip

* wip

* wip

* wip

not a fan of the way I do handles ..

* errors and async semantic

* fix example
This commit is contained in:
Théo Monnom
2023-01-25 00:09:19 +01:00
committed by GitHub
parent 84d2f234f5
commit 1610f86316
24 changed files with 1231 additions and 66 deletions
+3 -3
View File
@@ -5,7 +5,7 @@ use crate::rtc_engine::{EngineEvent, EngineEvents, EngineResult, RTCEngine};
use crate::signal_client::SignalOptions;
use crate::{RoomError, RoomEvent, RoomResult, SimulateScenario};
use livekit_utils::observer::Dispatcher;
use parking_lot::{Mutex, RwLock};
use parking_lot::{Mutex, RwLock, RwLockReadGuard};
use std::collections::HashMap;
use std::sync::atomic::{AtomicU8, Ordering};
use std::sync::Arc;
@@ -149,8 +149,8 @@ impl RoomSession {
self.inner.state.load(Ordering::Acquire).try_into().unwrap()
}
pub fn participants(&self) -> &RwLock<HashMap<ParticipantSid, Arc<RemoteParticipant>>> {
&self.inner.participants
pub fn participants(&self) -> RwLockReadGuard<HashMap<ParticipantSid, Arc<RemoteParticipant>>> {
self.inner.participants.read()
}
pub async fn simulate_scenario(&self, scenario: SimulateScenario) -> EngineResult<()> {