public void enqueueTempEvents() {
    if (eventProcessor != null) {// Fix for defect #47308
      // process tmpDroppedEvents
      EntryEventImpl droppedEvent;
      while ((droppedEvent = tmpDroppedEvents.poll()) != null) {
        eventProcessor.registerEventDroppedInPrimaryQueue(droppedEvent);
      }

      TmpQueueEvent nextEvent = null;
      final GatewaySenderStats stats = getStatistics();
      try {
        // Now finish emptying the queue with synchronization to make
        // sure we don't miss any events.
        synchronized (queuedEventsSync) {
          while ((nextEvent = tmpQueuedEvents.poll()) != null) {
            try {
              if (logger.isDebugEnabled()) {
                logger.debug("Event :{} is enqueued to GatewaySenderQueue from TempQueue",
                    nextEvent);
              }
              stats.decTempQueueSize();
              eventProcessor.enqueueEvent(nextEvent.getOperation(), nextEvent.getEvent(),
                  nextEvent.getSubstituteValue());
            } finally {
              nextEvent.release();
            }
          }
          enqueuedAllTempQueueEvents = true;
        }
      } catch (CacheException e) {
        logger.debug("caught cancel exception", e);
      } catch (IOException e) {
        logger.fatal(String.format(
            "%s: An Exception occurred while queueing %s to perform operation %s for %s",
            this, getId(), nextEvent.getOperation(), nextEvent),
            e);
      }
    }
  }
During sender is getting started, if there are any cache operation on queue then that event
will be stored in temp queue. Once sender is started, these event from tmp queue will be added
to sender queue.

Apart from sender's start() method, this method also gets called from
ParallelGatewaySenderQueue.addPartitionedRegionForRegion(). This is done to support the
postCreateRegion scenario i.e. the sender is already running and region is created later. The
eventProcessor can be null when the method gets invoked through this flow:
ParallelGatewaySenderImpl.start() -> ParallelGatewaySenderQueue.<init> ->
ParallelGatewaySenderQueue.addPartitionedRegionForRegion
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java