Posts the given event to the event bus and holds on to the event (because it is sticky). The most recent sticky event of an event's type is kept in memory for future access by subscribers using Subscribe#sticky().
(Object event)
| 309 | * event of an event's type is kept in memory for future access by subscribers using {@link Subscribe#sticky()}. |
| 310 | */ |
| 311 | public void postSticky(Object event) { |
| 312 | synchronized (stickyEvents) { |
| 313 | stickyEvents.put(event.getClass(), event); |
| 314 | } |
| 315 | // Should be posted after it is putted, in case the subscriber wants to remove immediately |
| 316 | post(event); |
| 317 | } |
| 318 | |
| 319 | /** |
| 320 | * Gets the most recent sticky event for the given type. |