[Pharo-project] [ENH]: Zinc - Streaming Download Progress

Sven Van Caekenberghe sven at beta9.be
Thu Jul 12 16:00:08 EDT 2012


It is better explained with code ;-)

With:

Sven Van Caekenberghe uploaded a new version of Zinc-HTTP to project Zinc HTTP Components:
http://www.squeaksource.com/ZincHTTPComponents/Zinc-HTTP-SvenVanCaekenberghe.285.mcz

==================== Summary ====================

Name: Zinc-HTTP-SvenVanCaekenberghe.285
Author: SvenVanCaekenberghe
Time: 12 July 2012, 9:58 am
UUID: e992fd76-efde-4b31-b4b4-bd468f8176f2
Ancestors: Zinc-HTTP-SvenVanCaekenberghe.284

enabled HTTPProgress signalling during streaming up/downloads.
introduction of ZnSignalProgress with #enabled method

=================================================

You should now be able to do something like:

UIManager default informUserDuring: [ :bar |
	[
		 '/Users/sven/Desktop/test-99425.txt' asFileReference ensureDeleted.
		^ ZnClient new
			signalProgress: true;
			url: 'http://s3-eu-west-1.amazonaws.com/public-stfx-eu/test-99425.txt';
			downloadTo: '/Users/sven/Desktop/' ]
		on: HTTPProgress 
		do: [ :progress | 
			bar label: progress printString.
			progress total ifNotNil: [ 
					1 second asDelay wait. 
					bar current: (progress amount / progress total) * 100 ]. 
			progress resume ] ].

Sven

On 12 Jul 2012, at 19:11, Sean P. DeNigris wrote:

> 
> Sven Van Caekenberghe wrote
>> 
>> There is already a usecase in ZnConnectionTimeout.
>> 
> 
> Okay, I checked out the code. How does that concept apply here? Maybe a
> quick example?
> 
> Thanks,
> Sean
> 
> --
> View this message in context: http://forum.world.st/ENH-Zinc-Streaming-Download-Progress-tp4639686p4639711.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
> 





More information about the Pharo-dev mailing list