[Seaside] REST and Seaside
David T. Lewis
lewis at mail.msen.com
Sat Apr 9 19:55:23 CEST 2005
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OSProcessBackgroundImageSave-dtl.cs.gz
Type: application/x-gunzip
Size: 860 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20050409/84819103/OSProcessBackgroundImageSave-dtl.cs.bin
More information about the Seaside
mailing list