asmblah / uniter

🎉 PHP in the browser and Node.js => Docs: https://phptojs.com/
https://asmblah.github.io/uniter/
Other
446 stars 42 forks source link

Documentation on how to use async API #55

Open neimanpinchas opened 4 years ago

neimanpinchas commented 4 years ago

I would like to mimic the mysql api

However i could'nt figure out how to use the async API from uniter.

Could be its only possible from phpcore but could'nt figure out this too.

Any help?

asmblah commented 4 years ago

Hi @neimanpinchas,

There aren't any docs I can point you to for the different modes (yet) unfortunately, sorry about that. Are you hoping to do this as a feature to be included in the runtime (to go into phpruntime) or do you want to keep it separate?

I'm asking because if you want to contribute to the runtime then it would be easiest to fork the phpruntime project and make your changes there. For an example, check out the way usleep(...) is implemented: https://github.com/uniter/phpruntime/blob/master/src/builtin/functions/time.js

If you want to keep it separate, then there's not (yet) a nice API for installing plugins in the command-line binary run under Node.js, although that would be a really handy feature that I'd like to roadmap. Let me know if that's what you need here.

Let me know how you get on, and ask any questions you need here!

Cheers

neimanpinchas commented 4 years ago

I am not yet 100% stable, in the phpcore mechanics, to take responsibility for adding the mysql project in the runtime

Also adding a dependency to node-mysql2 will make the whole project heavier, so could be that it should be a plugin.

The usleep was enough for me, to get the concept, i think of creating the engine with a a custom php runtime phpRuntime, and using runtime.install...

Once i will have something workable, i will do a PR and let others decide if it fits into the main phpRuntime

Maybe making a configuration object in the runtime construction, to select which components to load?

On Wed, Dec 4, 2019 at 3:07 PM Dan Phillimore notifications@github.com wrote:

Hi @neimanpinchas https://github.com/neimanpinchas,

There aren't any docs I can point you to for the different modes (yet) unfortunately, sorry about that. Are you hoping to do this as a feature to be included in the runtime (to go into phpruntime) or do you want to keep it separate?

I'm asking because if you want to contribute to the runtime then it would be easiest to fork the phpruntime project and make your changes there. For an example, check out the way usleep(...) is implemented: https://github.com/uniter/phpruntime/blob/master/src/builtin/functions/time.js

If you want to keep it separate, then there's not (yet) a nice API for installing plugins in the command-line binary run under Node.js, although that would be a really handy feature that I'd like to roadmap. Let me know if that's what you need here.

Let me know how you get on, and ask any questions you need here!

Cheers

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asmblah/uniter/issues/55?email_source=notifications&email_token=AEBHJLM25QAL5LMANS7BUW3QXAEZRA5CNFSM4JUOMW5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF6KRGI#issuecomment-561817753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBHJLJQCZ6IR6CNB4UPLYLQXAEZRANCNFSM4JUOMW5A .

-- Pinchas S. Neiman 845.213.1229 #2

With Hashems help, from end to start

Yeshiva Net http://www.yeshivanet.commobile as my internet guard

Wizmage https://chrome.google.com/webstore/detail/wizmage-image-hider/ifoggbfaoakkojipahnplnbfnhhhnmlp?hl=encovers every image with a card

So I feel protected, safe, clever and smart

Yeshiva Net mobile, is fast, provider based, and easy to setup, with excellent customer service

If you need something category based, you may consider netsafepro.com http://netsafepro.com

asmblah commented 4 years ago

Good luck and keep me posted on how you get on @neimanpinchas!

Yes, a simple way of specifying plugins to use is badly needed - I'm thinking a .uniterrc or uniter.config.js or uniter.json, something along those lines (although it should probably also pick up on the system php.ini if present)