我正在寫一個Action in Play應該在MongoDB中添加一個文檔,如果它不存在的話。我嘗試了兩種方法,但都沒有工作。我卡住周圍如何處理未來響應mongoplugin 行動獲取JSON數據。它減弱它。如果JSON正常,我會檢查用戶是否存在(查看名字)。如果它不,我想添加它,否則返回一個錯誤。我無法將ReactiveMongoPlugin的「查找」和「插入」方法結合在同一個動作中。 方法1
我有以下代碼: extern crate futures;
extern crate futures_cpupool;
extern crate tokio_timer;
use std::time::Duration;
use futures::Future;
use futures_cpupool::CpuPool;
use tokio_timer::Timer;
fn w
考慮下面的代碼 extern crate futures;
use std::sync::{atomic, Arc};
use futures::*;
struct F(Arc<atomic::AtomicBool>);
impl Future for F {
type Item =();
type Error =();
fn poll(&mut se
io.grpc.StatusRuntimeException: CANCELLED
at io.grpc.Status.asRuntimeException(Status.java:539)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:439)
at io.grpc.