Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement exe control with native class shell.SubProcess (google code Issue 15) #45

Open
zwetan opened this issue Dec 29, 2015 · 2 comments

Comments

@zwetan
Copy link
Member

zwetan commented Dec 29, 2015

https://code.google.com/p/redtamarin/issues/detail?id=15


a mix between popen
and how JSDB use Stream


in short we want to add avmplus.Process in a cross-platform way

we can take high inspiration from the Chrome browser code, in /base they have implemented cross-platform processes in a nice way


System.popen() exists in release 0.3

a Process class shoudl be the next step


we will have a Process class


this SubProcess is even more important when you think it's what we need to wrap external external command line tools control

eg. you can include ffmpeg headers in the runtime
it will make it harder and more comoplex to complie
the runtime will grow etc.

it's possible but not wanted

but if you could just wrap the stdin/stdout/stderr around ffmpeg
and call it from AS3 code, then things get simpler and powerful

also, for redbean, as we plan to use it as compiler tool
and so reuse asc.jar but also maybe MXMLC COMPC etc.
we end up with the same use case

we need a very good subprocess control class


@zwetan
Copy link
Member Author

zwetan commented Dec 29, 2015

few more notes

popen is nice but is not enough, see things like popen2, popen3, etc.
also pipe

this mainly related to standard streams (that we had in a previous native class)
as we want to be able to execute an external process
wether it is an executable, a shell script, etc.
and be able to read/write input, output, error streams (either string or binary)
and/or be able to redirect those

see AIR NativeProcess

@zwetan
Copy link
Member Author

zwetan commented Dec 29, 2015

also other things to have

  • be able to force BINARY mode under windows as it's not the default
  • a StandardStream class/interface/implementation should inherit from IDataInput and/or IDataOutput
  • ideally we should be able to pipe binary streams between 2 projectors to exchange AMF data
  • this is also important for server-side to implement our own servers
    we would want to be able to have our server in the middle
    eg. user stream <--> server streams <--> process streams (CGI)
  • we should also be able to buffer the output stream for servers
    eg. like ob_start() in PHP
  • this should also work nicely with fork(), spawn(), workers
    eg. keep my process and execute an external process
    or replace my process with an external process

@zwetan zwetan added this to the 0.4.2 milestone Jan 27, 2016
@zwetan zwetan modified the milestones: 0.4.3, 0.4.2 Jul 30, 2016
@zwetan zwetan removed this from the 0.4.3 milestone Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant