[Seaside] REST and Seaside (correction)
David T. Lewis
lewis at mail.msen.com
Sat Apr 9 20:18:05 CEST 2005
Terribly sorry folks, I carelessly copied the wrong code snippet. The
one I posted earlier will *not* work. The correct version is attached,
and the original example doit should have been this:
UnixProcess forkSqueakAndDo: [
| newName timeStamp st |
timeStamp := (TimeStamp current printString first: 19) copyReplaceAll: ':' with: '-'.
newName _ 'squeak-', timeStamp.
st := SmalltalkImage current.
(Delay forMilliseconds: 200) wait.
(SourceFiles at: 2) ifNotNil:
[st closeSourceFiles; "so copying the changes file will always work"
saveChangesInFileNamed: (st fullNameForChangesNamed: newName)].
st changeImageNameTo: newName,'.image';
closeSourceFiles;
openSourceFiles; "so SNAPSHOT appears in new changes file"
saveImageSegments;
snapshot: true andQuit: true]
On Sat, Apr 09, 2005 at 01:55:23PM -0400, David T. Lewis wrote:
> Here is the same thing packaged up in a change set. I'll include it
> with OSProcess next time I release something.
>
> To save an image in background, evaluate "UnixProcess saveImageInBackground".
>
> Dave
>
> On Sat, Apr 09, 2005 at 12:27:39PM -0400, David T. Lewis wrote:
> > Hi Nevin,
> >
> > I would guess that those large image saves could make your server
> > appear to lock up for a half minute. If that is the case, and if you
> > have lots of physical memory on your server, you can probably hide
> > this from your users by doing something like this for the image saves:
> >
> > UnixProcess forkHeadlessSqueakAndDo: [
> > | newName timeStamp st |
> > timeStamp := (TimeStamp current printString first: 19) copyReplaceAll: ':' with: '-'.
> > newName _ 'squeak-', timeStamp.
> > st := SmalltalkImage current.
> > (Delay forMilliseconds: 200) wait.
> > (SourceFiles at: 2) ifNotNil:
> > [st closeSourceFiles; "so copying the changes file will always work"
> > saveChangesInFileNamed: (st fullNameForChangesNamed: newName)].
> > st saveImageInFileNamed: (st fullNameForImageNamed: newName).
> > st snapshot: false andQuit: true]
> >
> > Your main Squeak server image will keep running without interruption while
> > another headless Squeak saves the image. Even though it runs another Squeak
> > image, it won't use much real memory (the two Squeaks share most of the same
> > memory space due to Unix memory management).
> >
> > OSProcess is on SqueakMap. I'm assuming you are using a Unix/Linux server,
> > hopefully my recollection is correct.
> >
> > Test this carefully, I just hacked it together in response to your post, and
> > it's not something I have a need to use myself. But it should help get rid
> > of the big delays your users are seeing.
> >
> > HTH,
> > Dave
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OSProcessBackgroundImageSave-dtl.cs.gz
Type: application/x-gunzip
Size: 908 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20050409/edc0bea1/OSProcessBackgroundImageSave-dtl.cs.bin
More information about the Seaside
mailing list