Can PHP and C++ pass data between each other?

后端 未结 11 1775
悲哀的现实
悲哀的现实 2020-12-14 20:36

I have a lot of mathematical calculations in my PHP script, which can be quite slow at times. I\'m wondering if it\'s possible to pass data from PHP to C++, do the calculati

11条回答
  •  清歌不尽
    2020-12-14 20:47

    If you want to handle these asynchronously, you could take a look at Beanstalkd, which acts as a job queue, storing chunks of data to be picked up by another process for processing. So you could write a C++ process that sits there waiting for something to do, and picks up work from Beanstalkd. Beanstalkd is not only fast, but can also be distributed.

    There are a couple of C(++) client libraries for beanstalkd available https://github.com/kr/beanstalkd/wiki/client-libraries.

提交回复
热议问题