MCPcopy Create free account
hub / github.com/OAID/Tengine / Send

Method Send

core/lib/notify_instance.cpp:239–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239bool NotifyBus::Send(int event, EventData* data, int priority)
240{
241 EventNode* node = GetNode(event);
242
243 if(node == nullptr)
244 return false;
245
246 int count = GetPendingCount(node);
247
248 if(count >= max_pending_num_)
249 {
250 node->send_fail_count++;
251 PutNode(node);
252 return false;
253 }
254
255 node->event_tree[priority].emplace(*data);
256
257 node->send_count++;
258
259 if(!node->active)
260 {
261 node->active = true;
262
263 pending_queue_mutex.lock();
264
265 pending_queue.push(node);
266
267 pending_queue_mutex.unlock();
268 }
269
270 PutNode(node);
271
272 return true;
273}
274
275bool NotifyBus::Send(const std::string& event_name, EventData* data, int priority)
276{

Callers 3

EventSenderFunction · 0.80
Eventhandler0Function · 0.80
echo_threadFunction · 0.80

Calls

no outgoing calls

Tested by 3

EventSenderFunction · 0.64
Eventhandler0Function · 0.64
echo_threadFunction · 0.64