private void pushSnapshot ( final Timestamp readTime , ByteString nextResumeToken ) { final List < DocumentChange > changes = computeSnapshot ( readTime ) ; if ( ! hasPushed || ! changes . isEmpty ( ) ) { final QuerySnapshot querySnapshot = QuerySnapshot . withChanges ( query , readTime , documentSet , changes ) ; userCallbackExecutor . execute ( new Runnable ( ) { @ Override public void run ( ) { listener . onEvent ( querySnapshot , null ) ; } } ) ; hasPushed = true ; } changeMap . clear ( ) ; resumeToken = nextResumeToken ; }
Assembles a new snapshot from the current set of changes and invokes the user s callback . Clears the current changes on completion .