-
Notifications
You must be signed in to change notification settings - Fork 118
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
change: Rust APIの脱Tokioと、voicevox_core::
{tokio
→nonblocking
}
#831
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//! 非同期版API。 | ||
//! | ||
//! # Performance | ||
//! | ||
//! これらは[blocking]クレートにより動いている。特定の非同期ランタイムを必要とせず、[pollster]など | ||
//! でも動かすことができる。 | ||
//! | ||
//! スレッドプールおよびエグゼキュータはblockingクレートに依存するすべてのプログラム間で共有される。 | ||
//! スレッドプールのサイズは、blockingクレートの説明にある通り`$BLOCKING_MAX_THREADS`で調整すること | ||
//! ができる。 | ||
//! | ||
//! [blocking]: https://docs.rs/crate/blocking | ||
//! [pollster]: https://docs.rs/crate/pollster | ||
|
||
pub use crate::{ | ||
engine::open_jtalk::nonblocking::OpenJtalk, | ||
infer::runtimes::onnxruntime::nonblocking::Onnxruntime, synthesizer::nonblocking::Synthesizer, | ||
user_dict::dict::nonblocking::UserDict, voice_model::nonblocking::VoiceModel, | ||
}; | ||
|
||
pub mod onnxruntime { | ||
#[cfg(feature = "load-onnxruntime")] | ||
#[cfg_attr(docsrs, doc(cfg(feature = "load-onnxruntime")))] | ||
pub use crate::infer::runtimes::onnxruntime::nonblocking::LoadOnce; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
・・・・・・・あれ、これどういうことでしたっけ。。。
blokingモジュール(クレート)があって、これはAsyncを実装してくれてる感じ・・・?
(プレーンなRustのasyncは非同期の機能がなく、非同期用のクレートを使わないと非同期にできない、という理解でいます)
blocking、名前めちゃくちゃややこしいですね・・・。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そうですね。こんな感じです。
voicevox_core::blocking
: パブリックAPIの一部voicevox_core::nonblocking
: パブリックAPIの一部。内部でblocking(外部ライブラリ名)を使っているですね。
前身としてunblockという、
unblock::unblock(…)
という形で使えるクレートがあって更新が途絶えているのですが、よく見たらこれblockingより前に誕生したものですね。なんでこの名前にしなかったんだろう…2回くらい言ったかもしれませんが、せめてリポジトリ名(smol-rs/blocking)がblocking-rsとかだったらそっちで呼べるのに…