php-binance-api icon indicating copy to clipboard operation
php-binance-api copied to clipboard

[feature] Using custom-loop created outside of binance-api?

Open typoworx-de opened this issue 4 years ago • 2 comments

Is there any way to use a custom LoopInterface to create own code-logic around the api, create multiple subscriptions and use them in one LoopInterface?

For example if I would like to use ticker and trades function each of the api-methods creates an EventLoop inside the method provided by binance-api and therefore the whole php-script is only running in this loop.

I would prever being able to define my own EventLoop in my code, set this one to the api and create multiple subscriptions and callback-functions being able to run in parallel.

I think this could be simply archived. Create a 'setLoop' method accepting LoopInterface, set it to class-variable providing this custom-LoopInterface and in each api-method check if there is a custom LoopInterface ($this->loop) and only use local EventLoop\Factory::create if $this->loop is null.

typoworx-de avatar Jun 03 '21 07:06 typoworx-de

Hey @typoworx-de i'm not sure what this has to be with this api ?

dmzoneill avatar Jul 06 '21 08:07 dmzoneill

I think this could be simply archived.

Do it if you think so ) and dont forget to makle pull request

qant avatar Jul 27 '21 10:07 qant