MCPcopy Create free account
hub / github.com/apache/mesos / receive

Method receive

src/scheduler/scheduler.cpp:833–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831 }
832
833 void receive(const Event& event, bool isLocallyInjected)
834 {
835 // Check if we're are no longer subscribed but received an event.
836 if (!isLocallyInjected && state != SUBSCRIBED) {
837 LOG(WARNING) << "Ignoring " << stringify(event.type())
838 << " event because we're no longer subscribed";
839 return;
840 }
841
842 if (isLocallyInjected) {
843 VLOG(1) << "Enqueuing locally injected event " << stringify(event.type());
844 } else {
845 VLOG(1) << "Enqueuing event " << stringify(event.type()) << " received"
846 << " from " << master.get();
847 }
848
849 // Queue up the event and invoke the 'received' callback if this
850 // is the first event (between now and when the 'received'
851 // callback actually gets invoked more events might get queued).
852 events.push(event);
853
854 if (events.size() == 1) {
855 mutex.lock()
856 .then(defer(self(), &Self::_receive))
857 .onAny(lambda::bind(&Mutex::unlock, mutex));
858 }
859 }
860
861private:
862 struct Callbacks

Callers

nothing calls this directly

Calls 9

deferFunction · 0.85
typeMethod · 0.80
pushMethod · 0.80
lockMethod · 0.80
stringifyFunction · 0.50
bindFunction · 0.50
getMethod · 0.45
sizeMethod · 0.45
thenMethod · 0.45

Tested by

no test coverage detected