mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-10-31 02:50:08 +00:00 
			
		
		
		
	docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									a5b618ab8c
								
							
						
					
					
						commit
						d15d516676
					
				| @ -38,6 +38,8 @@ var pwpath = require('../path') | |||||||
| //	<index-handler>('get')
 | //	<index-handler>('get')
 | ||||||
| //		-> <data>
 | //		-> <data>
 | ||||||
| //		-> <promise>
 | //		-> <promise>
 | ||||||
|  | // 		NOTE: when a getter is pending (promise), all consecutive calls 
 | ||||||
|  | // 			will resolve the original getter return value...
 | ||||||
| //
 | //
 | ||||||
| //	Get cached result and do "lazy" background update... (XXX EXPERIMENTAL)
 | //	Get cached result and do "lazy" background update... (XXX EXPERIMENTAL)
 | ||||||
| //	<index-handler>('lazy')
 | //	<index-handler>('lazy')
 | ||||||
| @ -46,6 +48,9 @@ var pwpath = require('../path') | |||||||
| // 		NOTE: 'lazy' mode is generally faster as it does all the checks and 
 | // 		NOTE: 'lazy' mode is generally faster as it does all the checks and 
 | ||||||
| // 			updating (if needed) in a background promise, but can return 
 | // 			updating (if needed) in a background promise, but can return 
 | ||||||
| // 			outdated cached results.
 | // 			outdated cached results.
 | ||||||
|  | // 		NOTE: as a side-effect this avoids returning promises if a cached 
 | ||||||
|  | // 			value is available. i.e. a promise is returned only when 
 | ||||||
|  | // 			getting/generating a value for the first time.
 | ||||||
| //
 | //
 | ||||||
| //	Get local data (uncached)...
 | //	Get local data (uncached)...
 | ||||||
| //	<index-handler>('local')
 | //	<index-handler>('local')
 | ||||||
| @ -65,9 +70,6 @@ var pwpath = require('../path') | |||||||
| //		-> <data>
 | //		-> <data>
 | ||||||
| //		-> <promise>
 | //		-> <promise>
 | ||||||
| //
 | //
 | ||||||
| // NOTE: when a getter is pending (promise), all consecutive calls will
 |  | ||||||
| // 		resolve the original getter return value...
 |  | ||||||
| //
 |  | ||||||
| //
 | //
 | ||||||
| //
 | //
 | ||||||
| // Special methods:
 | // Special methods:
 | ||||||
| @ -177,7 +179,8 @@ function(name, generate, options={}){ | |||||||
| 					function(value){ | 					function(value){ | ||||||
| 						delete obj[promise] | 						delete obj[promise] | ||||||
| 						obj[cache] = value }, | 						obj[cache] = value }, | ||||||
| 					function(){ | 					function(err){ | ||||||
|  | 						// XXX should we report this???
 | ||||||
| 						delete obj[promise] }) } | 						delete obj[promise] }) } | ||||||
| 			val = obj[promise] } | 			val = obj[promise] } | ||||||
| 		return val } | 		return val } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user