-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tokioに依存したプログラムは、async-stdやsmolで使うことはできない。一方、 現在のVOICEVOX CORE Rust APIのTokio依存部分は `tokio::task::spawn_blocking`のみである。そのため `tokio::task::spawn_blocking`を、同等の機能を持つblockingクレートのも のに置き換えることでRust APIの"脱Tokio"を行う。 https://docs.rs/crate/blocking またこの"脱Tokio"に伴い、Rust APIの`voicevox_core::tokio`を `voicevox_core::nonblocking`にリネームする。 Python APIではpyo3-asyncioが現在Tokio版かasync-std版しかない状態なので、 Tokioに依存した状態のままにしてある。またtest_utilやdownloaderではこれま で通りreqwestに依存する。 また将来`Synthesizer`や`OpenJtalk`なども`trait Async`をベースにした設計 にすることを考えているが、本PRではTODOコメントを残すのみにしてある。 #830 (comment)
- Loading branch information
Showing
19 changed files
with
257 additions
and
141 deletions.
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.