MCPcopy Index your code
hub / github.com/greenrobot/EventBus / post

Method post

EventBus/src/org/greenrobot/eventbus/EventBus.java:262–282  ·  view source on GitHub ↗

Posts the given event to the event bus.

(Object event)

Source from the content-addressed store, hash-verified

260
261 /** Posts the given event to the event bus. */
262 public void post(Object event) {
263 PostingThreadState postingState = currentPostingThreadState.get();
264 List<Object> eventQueue = postingState.eventQueue;
265 eventQueue.add(event);
266
267 if (!postingState.isPosting) {
268 postingState.isMainThread = isMainThread();
269 postingState.isPosting = true;
270 if (postingState.canceled) {
271 throw new EventBusException("Internal error. Abort state was not reset");
272 }
273 try {
274 while (!eventQueue.isEmpty()) {
275 postSingleEvent(eventQueue.remove(0), postingState);
276 }
277 } finally {
278 postingState.isPosting = false;
279 postingState.isMainThread = false;
280 }
281 }
282 }
283
284 /**
285 * Called from a subscriber's event handling method, further event delivery will be canceled. Subsequent

Callers 8

postStickyMethod · 0.95
postSingleEventMethod · 0.95
executeMethod · 0.45
runMethod · 0.45
runTestMethod · 0.45
runTestMethod · 0.45

Calls 3

isMainThreadMethod · 0.95
postSingleEventMethod · 0.95
getMethod · 0.45

Tested by 4

runMethod · 0.36
runTestMethod · 0.36
runTestMethod · 0.36