mirror of
				https://github.com/flynx/guaranteeEvents.git
				synced 2025-10-31 03:50:15 +00:00 
			
		
		
		
	documented the .clearGuaranteedQueue(..) method...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									af131afe2f
								
							
						
					
					
						commit
						e02f6f3742
					
				
							
								
								
									
										21
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								README.md
									
									
									
									
									
								
							| @ -74,3 +74,24 @@ results.on('match', function(path){ console.log('found: '+path) }) | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
|  | 
 | ||||||
|  | Cache cleaning and use for long running emitters | ||||||
|  | ------------------------------------------------ | ||||||
|  | 
 | ||||||
|  | This is not recommended for use in long running event emitters as each | ||||||
|  | event emitted data will get stored and might get quite large, i.e. a | ||||||
|  | potential source for a leak. | ||||||
|  | 
 | ||||||
|  | To deal with this issue a `.clearGuaranteedQueue(<event>)` method is  | ||||||
|  | added to the emitter, this will clear the cache for a specific event and | ||||||
|  | a shorthand form `.clearGuaranteedQueue('*')` that will clear the cache | ||||||
|  | for all wrapped events. | ||||||
|  | 
 | ||||||
|  | So for the above example: | ||||||
|  | ```javascript | ||||||
|  | // This this will drop all the prior matches, so newly registred handlers | ||||||
|  | // will not see them... | ||||||
|  | results.clearGuaranteedQueue('match') | ||||||
|  | 
 | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user