We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbe96fd commit 9e06319Copy full SHA for 9e06319
1 file changed
section5/srv.cpp
@@ -59,7 +59,7 @@ try
59
60
for(;;) {
61
62
- // shared_ptr/unique_ptr
+ // xxx : shared_ptr/unique_ptr
63
auto msg_ptr = std::make_shared<zmq_message_type>();
64
65
sock.recv(msg_ptr.get());
@@ -75,6 +75,7 @@ try
75
76
SalesData book;
77
78
+ // xxx: json/msgpack/protobuf
79
auto obj = msgpack::unpack(
80
ptr->data<char>(), ptr->size()).get();
81
obj.convert(book);
@@ -87,9 +88,9 @@ try
87
88
++count;
89
cout << count << endl;
90
},
- msg_ptr);
91
- }
92
- };
+ msg_ptr); // async
+ } // for(;;)
93
+ }; // recv_cycle lambda
94
95
auto log_cycle = [&]()
96
{
@@ -115,8 +116,8 @@ try
115
116
if (res.status_code != 200) {
117
cout << "http post failed" << endl;
118
}
119
120
+ }; // log_cycle lambda
121
122
// launch recv_cycle then wait
123
auto fu = std::async(std::launch::async,
0 commit comments