We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86c07cd commit 690040aCopy full SHA for 690040a
Examples/WorkContractExample.cpp
@@ -2,14 +2,28 @@
2
// Created by Geenz on 8/8/25.
3
//
4
5
+
6
#include "WorkContractExample.h"
7
#include <iostream>
8
#include "../src/Concurrency/WorkContractGroup.h"
9
+#include "../src/Concurrency/WorkService.h"
10
using namespace EntropyEngine;
11
using namespace Core;
12
using namespace Concurrency;
13
14
int main() {
15
+ WorkService service{WorkService::Config()};
16
+ service.start();
17
+ WorkContractGroup group(1000);
18
19
+ for (int i = 0; i < 1000; i++) {
20
+ group.createContract([=]() {
21
+ printf("WorkContractGroup createContract %i\n", i);
22
+ }).schedule();
23
+ }
24
+ service.addWorkContractGroup(&group);
25
+ group.wait();
26
27
+ service.stop();
28
return 0;
29
}
-
0 commit comments