The Artima Developer Community
Sponsored Link

Agile Buzz Forum
New Dev update goodies

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
New Dev update goodies Posted: Aug 5, 2006 6:28 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: New Dev update goodies
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

I've made some improvements to the HTTP downloading code used in BottomFeeder. The stock code downloads everything into memory, with no real option to save to a file. I added some support code to do that a long while back for the upgrade tools, but they simply dropped the downloaded bytes to a file as soon as they were all in - which still filled a large memory buffer when it happened.

Now, that's been improved. I made some modifications to the HttpClient subclass I use in the upgrade tools, and gave it the ability to download straight to a file. This makes the EnclosureHandler practical - previously, using it could run past your memory settings, and cause problems (or simply cause excessive memory use). Now, that's no longer an issue. Next, I need to look at some code Blaine sent me. It was written for Dolphin, but the porting should mainly be in the file/stream area. It provides direct access to the iPod, which would be very nice.

The changes necessary weren't terribly complex - when the HttpClient starts grabbing data, it sets up a stream to download to in class HttpBuildHandler:

openBodyStream: aMessageBody
	aMessageBody isSimple 
		ifTrue: [aMessageBody setByteSource:  (ReadWriteStream on: (ByteArray new: 1024)) ]

All I did is have that code open a stream on a file (yes, it's simplistic - I only use this subclass to download files). The only hard part comes into cleanup; I trigger events so that the object that kicks off the download can move the file that's downloaded (to a temp file name) to the place and name it belongs. It works pretty well, and I'm happily using it. To get the update, you need to:

  • Be on version 4.2
  • Change your update path to end in /dev
  • Grab all available updates

If you try that and have problems, let me know.

Technorati Tags:

Read: New Dev update goodies

Topic: Joel Discovers Blocks Previous Topic   Next Topic Topic: David Simmons talks about S#

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use