This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/example/doric/async/DoricSettableFuture.h

22 lines
363 B
C
Raw Normal View History

2021-02-04 16:59:58 +08:00
#ifndef SETTABLE_FUTURE_H
#define SETTABLE_FUTURE_H
#include <QJSValue>
2021-05-18 16:15:28 +08:00
#include "DoricExport.h"
2021-02-04 16:59:58 +08:00
#include "utils/DoricCountDownLatch.h"
2021-05-18 16:15:28 +08:00
class DORIC_EXPORT DoricSettableFuture {
2021-02-04 16:59:58 +08:00
private:
QJSValue mResult;
DoricCountDownLatch *mReadyLatch = new DoricCountDownLatch();
public:
void set(QJSValue result);
QJSValue get();
};
#endif // SETTABLE_FUTURE_H