peachpie icon indicating copy to clipboard operation
peachpie copied to clipboard

Async functions in PeachPie

Open ghost opened this issue 4 years ago • 1 comments

I want to run PHP code through PeachPie asynchronously, i thought it would be possible to simply call a PHP class from C# code from an async function and that the subsequent call would run asynchronously but that doesn't seem to work. This feature would be a really nice addition, either by adding async functions directly into the PHP code somehow or allow C# async functions to run the php code asynchronously.

ghost avatar Oct 26 '21 21:10 ghost

PHP functions are compiled into regular non-async .NET methods; you can call them normally from async C# methods.

Since the underlying APIs for I/O operations are not async, compiling PHP code as async methods would not make any sense tho. We would have to make database API and echo operator async first so it would be reasonable to start compiling PHP functions as async methods.

jakubmisek avatar Oct 26 '21 21:10 jakubmisek