Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: impl SpeakerService #81

Merged
merged 4 commits into from
Jan 25, 2025
Merged

feat: impl SpeakerService #81

merged 4 commits into from
Jan 25, 2025

Conversation

ras0q
Copy link
Member

@ras0q ras0q commented Jan 25, 2025

No description provided.

@ras0q ras0q requested a review from H1rono January 25, 2025 03:16
Copy link
Member

@H1rono H1rono left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

migration書いて

server/src/event.rs Show resolved Hide resolved
server/src/speaker_phone.rs Show resolved Hide resolved
server/src/speaker_phone.rs Show resolved Hide resolved
server/src/speaker_phone/impl.rs Show resolved Hide resolved
@ras0q ras0q requested a review from H1rono January 25, 2025 04:13
@H1rono
Copy link
Member

H1rono commented Jan 25, 2025

// load_all_speaker_phones

use futures::TryStreamExt;

let speaker_phones = todo!();
for sp in speaker_phones {
    let rx = event_service.subscribe_messages().await?;
    task.spawn(|_token| async move {
        while let Some(message) = rx.try_next().await? {
            if todo!("spのアクセス範囲内にmessage.positionが含まれ ない") {
                continue;
            }
            traq_message_service.send_message(message).await?;
        }
    });
}

大体こうです

@H1rono
Copy link
Member

H1rono commented Jan 25, 2025

spawn内で?が使えないかもなので、その時は↓

match send_message(...).await {
    Ok(_) => { ... }
    Err(e) => {
        tracing::error!(...);
        return;
    }
}

@H1rono
Copy link
Member

H1rono commented Jan 25, 2025

#81 継続

@H1rono H1rono merged commit 2ec4ff9 into main Jan 25, 2025
4 checks passed
@H1rono H1rono deleted the feat/speaker-phone-impl branch January 25, 2025 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants