API
This commit is contained in:
parent
24431f2167
commit
25ee0246de
5 changed files with 173 additions and 43 deletions
|
|
@ -15,6 +15,9 @@ pub async fn add_community(community: Arc<Community>) {
|
|||
.await
|
||||
.insert(community.get_name().to_string(), community);
|
||||
}
|
||||
pub async fn remove_community(name: &str) {
|
||||
COMMUNITY_REGISTRY.lock().await.remove(name);
|
||||
}
|
||||
pub async fn get_community(name: &str) -> Option<Arc<Community>> {
|
||||
if let Some(c) = COMMUNITY_REGISTRY.lock().await.get(name) {
|
||||
Some(c.clone())
|
||||
|
|
|
|||
Loading…
Reference in a new issue