# How to create a service which is not shared with other requests in mezzio-swoole

**URL:** <https://discourse.laminas.dev/t/how-to-create-a-service-which-is-not-shared-with-other-requests-in-mezzio-swoole/2538>\
**Category:** Mezzio\
**Tags:** mezzio-swoole\
**Created:** [October 9, 2021, 12:26pm UTC](https://discourse.laminas.dev/t/how-to-create-a-service-which-is-not-shared-with-other-requests-in-mezzio-swoole/2538 "2021-10-09T12:26:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alban\_Hasa](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/alban_hasa/32/765_2.png) [@Alban\_Hasa](https://discourse.laminas.dev/u/Alban_Hasa)\
**Post date:** [October 9, 2021, 12:26pm UTC](https://discourse.laminas.dev/t/how-to-create-a-service-which-is-not-shared-with-other-requests-in-mezzio-swoole/2538/1 "2021-10-09T12:26:57Z")

</div>

Does any one have create a service in mezzio-swoole (e.g a database connection service) which is isolated for a request?  
I tried to create a custom mysqli class which extends mysqli in order to store some performance related information (e.g, total number of queries for a request, execution time for each query etc).  
This information is shared for all the requests.  
I read something for Factories as a service but do not know how to implement it.  
mezzio-swoole offers amazing performance, but this shared issue makes the di-container useless.
