pmmp / ext-pmmpthread

Fork of https://github.com/krakjoe/pthreads with a revamped API and PHP 8.1+ support
Other
82 stars 15 forks source link

Internal API for copy support via extensions #138

Open dktapps opened 9 months ago

dktapps commented 9 months ago

Currently it's inconvenient to publish shared libraries for the extension, as it may or may not depend on ext-sockets. There's no way to tell whether sockets support is required until the library attempts to be loaded, at which point it will bail out due to symbol loading errors.

It would probably be advantageous for pmmpthread to expose API to allow other extensions to register copy handlers for particular types. Socket copy support would then be moved to a separate extension ext-pmmpthread-sockets, simplifying the distribution process and allowing users to add socket support on their own if they want to.

This might also be useful for supporting other things, such as copying PalettedBlockArray in ext-chunkutils2 without making ext-chunkutils2 depend on pmmpthread or vice versa.