The trick is to create an independent process. A standalone that listens for
messages. Pass it some parameters and go on about your business. Multithreaded
computing on demand. AppleScript or open process doesn’t matter.
Sent from my iPhone
> On Aug 3, 2019, at 19:09, Dar Scott Consulting via
OK. Skip "cat" for now. Everything else should work on Windows.
To load a file in one swoop...
put URL("binfile:" & ThisFile) into IntoThisVariable
And if you saved the file with compress, then decompress it.
To load portions of a file just-in-time...
Use "at" and "for" in "read from"
That
On 04/08/2019 19:07, Tom Glod via use-livecode wrote:
Hmmm interesting.
I was sending binary variables to it, and the headers came through ok, but
the binary data didn't when it was over a certain size.
What sort of data sizes have you been been sending to your httpd standalone?
heheh its always a fun exercise.
Dar, these are linux based solutions right? using windows here at the
moment, so I can't test, but when I test and optimize my application for
linux i will try these.
On Sun, Aug 4, 2019 at 4:43 PM dsc--- via use-livecode <
use-livecode@lists.runrev.com>
Even more "really out there" of the "really out there".
Don't read in the file.
Access portions JIT, that is, lazily.
Create a function that pulls in segments of the file. Kinda like this:
function segmentOfFile pStartIndex, pEndIndex, pThisFile
Or this:
function
More "really out there".
I like the idea of trying to speed up an upfront foreground load. Something
simple like this:
put blah-plah into IntoThisVariable.
where blah-blah is nana-nana or decompress( nana-nana )
where nana-nana is one of these:
URL ("binfile:" & ThisFile)
I love "really out there". I wanna play.
At the start of any solution, try this. It might speed up any method but would
take some time at the start.
get shell( "cat " & ThisFile & " > dev/null" )
I think that is likely to pre-load the system file buffers for you.
If one is feeling
Hmmm interesting.
I was sending binary variables to it, and the headers came through ok, but
the binary data didn't when it was over a certain size.
What sort of data sizes have you been been sending to your httpd standalone?
My tests, were 18 months ago at least, but I am hoping it was
Oh, that's a bit worrying I'm just starting a project that will use
httpd, and it might in the medium term need to receive large data sets.
But for now, similar to this case of yours for "serving" files, it only
needs to send large data sets, and I have tested that pretty thoroughly
Hi Alex, yes that would definitely be a great option for a high performance
solution that would work well in the background.
I did tests on such a solution a while back (for a similar task), but found
that the httpd library was not able to receive large pieces of binary
data. It worked beautiful
OK, here's a "really out there" suggestion
1. Run a local web server to serve files (locally only).
Can be done various ways, including (easily) via LC and the httpd
library,
(build that server as a standalone and have it running -
started from your app if need be...)
Memory returns slowly…
I take back what I said about eof maybe working for serial ports. I’m pretty
sure it doesn’t. When I did this before I was taking data from 2 incoming
asynchronous serial ports, one then the other then repeat. They only had tiny
buffers, so I had to read small pieces of
Jerry, that simple tweak worked to improve the performance of the UI a
great deal.. its a slower method of loading...but not too slow
to use as background loading. ...Its actually better than what I
expected. Awesome.
I always love to use the forever loop. its just so fun to
Dar, Yes...I understand.it is a blocking operation no matter what I
can just introduce breaks in the blockiness. So I'm not expecting a socket
like experience for sure.
Those are very good suggestions to try thank you.
Jerry, I will give that a try, it looks promising.even a little
Hi Tom,
I’ve done this in the past watching it instead of the result. I seem to
remember eof was not useful. Maybe for a serial port it would be?
As in:
repeat forever
read from file ThisFile for (1024 * 1000) bytes
if it is empty then exit repeat
— do your stuff
wait 0 with messages
end
Alas, only read from socket allows a message to be sent upon completion. The
step siblings read from file, read from process and read from driver do not.
Here are a few things you might do:
1. Try making the file loading very fast and don't do it in the background.
Change the cursor if need
Hey folks,
I'm having trouble finding a combination of settings that allows my file
loading to seem to happen in the background.
repeat while read_result is not "eof"
read from file ThisFile for (1024 * 1000) bytes
put the result into read_result
put it after
17 matches
Mail list logo