PHPackages                             teknasyon/guzzle-async-pool - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. teknasyon/guzzle-async-pool

ActiveLibrary[HTTP &amp; Networking](/categories/http)

teknasyon/guzzle-async-pool
===========================

2.0.0(3y ago)4221PHP

Since Aug 4Pushed 3y ago2 watchersCompare

[ Source](https://github.com/Teknasyon-Teknoloji/guzzle-async-pool)[ Packagist](https://packagist.org/packages/teknasyon/guzzle-async-pool)[ RSS](/packages/teknasyon-guzzle-async-pool/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Hakkında
========

[](#hakkında)

Bu kütüphane [GuzzleHttp\\Pool](http://docs.guzzlephp.org/en/stable/quickstart.html#concurrent-requests) sınıfının özellikle Soap için kullanımını kolaylaştırmayı amaçlamaktadır.

Demo
====

[](#demo)

**example** klasöründe bulunan örnek kodları çalıştırmak için sırasıyla aşağıdaki komutları çalıştırabilirsiniz:

```
$ docker run -it --rm -v $(pwd):/app composer update
$ cd example
$ docker build -t testserver .
$ docker run -d -p 8080:80 -v $(pwd):/var/www/html testserver
$ php test.php
$ php test_guzzle_pool.php
```

Kurulum
=======

[](#kurulum)

Kütüphaneyi projenizde kullanmak için composer.json dosyanıza aşağıdaki satırları ekleyin ve composer update komutunu çalıştırın:

```
"require": {
    "teknasyon/guzzle-async-pool": "1.0"
}

```

Kullanım
========

[](#kullanım)

Soap servisine yapılacak istekler kütüphane içerisindeki **Teknasyon\\GuzzleAsyncPool\\SoapRequestFactory** sınıfı ile oluşturulabilir. Bu sınıfın factory metodu kullanılarak istek gönderimi için gerekli olan **GuzzleHttp\\Psr7\\Request** türünde bir obje üretilir. Örnek kullanım:

```
// Soap servisinin wsdl dosyası
$wsdl = 'http://127.0.0.1:8080/soap_server.php?wsdl';
// Soap servis adresi
$endpoint = 'http://127.0.0.1:8080/soap_server.php';
// İstekte bulunulacak SoapAction bilgisi
$soapAction = 'http://tempuri.org/Multiply';
// İstekte bulunulacak fonksiyon adı.
$functionName = 'Multiply';
// İstekte bulunulacak fonksiyon için parametreler.
$functionParams = ['intA' => 10, 'intB' => 3];
$request = SoapRequestFactory::factory(
    $wsdl,
    $endpoint,
    $soapAction,
    $functionName,
    $functionParams
);
```

Üretilen istek objeleri **Teknasyon\\GuzzleAsyncPool\\Pool** sınıfı vasıtasıyla gönderilir. Bu sınıfın **onCompletedRequest**metodu ile başarılı istek cevaplarını, **onFailedRequest** isimli metodu ile hatalı istek cevapları dinlenir.

```
$requests = [
    SoapRequestFactory::factory(
        'http://127.0.0.1:8080/soap_server.php?wsdl',
        'http://127.0.0.1:8080/soap_server.php',
        'http://tempuri.org/Add',
        'Add',
        ['intA' => 10, 'intB' => 3]
    ),
    SoapRequestFactory::factory(
        'http://127.0.0.1:8080/soap_server.php?wsdl',
        'http://127.0.0.1:8080/soap_server.php',
        'http://tempuri.org/Subtract',
        'Subtract',
        ['intA' => 10, 'intB' => 3]
    ),
    SoapRequestFactory::factory(
        'http://127.0.0.1:8080/soap_server.php?wsdl',
        'http://127.0.0.1:8080/soap_server.php',
        'http://tempuri.org/Multiply',
        'Multiply',
        ['intA' => 10, 'intB' => 3]
    )
];

$guzzlePoolSettings = ['concurrency' => 5];
$guzzleClient = new Client();
$pool = new Teknasyon\GuzzleAsyncPool\Pool($requests, $guzzlePoolSettings, $guzzleClient);
$pool->onCompletedRequest(function ($index, RequestInterface $request, ResponseInterface $response) {
});
$pool->onFailedRequest(function ($index, RequestInterface $request, \Exception $exception) {
});
$pool->wait();

```

**onCompletedRequest** metodu ile tanımlayacağınız fonksiyon sırasıyla şu parametreleri alır:

- **$index:** İstek objesinin $requests dizisindeki indis değerini belirtir.
- **$request:** İstek objesi.
- **$response:** Yanıt objesi.

**onFailedRequest** metodu ile tanımlayacağınız fonksiyon sırasıyla şu parametreleri alır:

- **$index:** İstek objesinin $requests dizisindeki indis değerini belirtir.
- **$request:** İstek objesi.
- **$exception:** Hata objesi. Hata objesi **GuzzleHttp\\Exception\\RequestException** türünde ise **$exception-&gt;getResponse()** üzerinden Response objesine erişebilirsiniz.

Soap istek ve yanıtlarının dönüştürülmesi
=========================================

[](#soap-istek-ve-yanıtlarının-dönüştürülmesi)

**Teknasyon\\GuzzleAsyncPool\\SoapRequestFactory** sınıfı belirtilen parametrelere göre otomatik olarak XML içeriğini hazırlar ve bu içeriği kullanarak Request objesini oluşturur. Bunun için özel bir işlem yapmanıza gerek yok. Ancak soap yanıtları için **Teknasyon\\GuzzleAsyncPool\\Soap\\Decoder** sınıfını kullanmalısınız. Bu sınıf aldığınız XML cevabını PHP dizisine dönüştürmektedir. **onCompletedRequest** ya da **onFailedRequest** metodları içinde elde ettiğiniz **Psr\\Http\\Message\\ResponseInterface** türündeki objeler vasıtasıyla cevabı dönüştürebilirsiniz.

```
$pool->onCompletedRequest(function ($index, RequestInterface $request, ResponseInterface $response) use ($startTime) {
    $soapResponse = Decoder::decode($response->getBody()->getContents());
    ...
});
$pool->onFailedRequest(function ($index, RequestInterface $request, \Exception $exception) use ($startTime) {
    $soapResponse = null;
    if ($exception instanceof RequestException) {
        $soapResponse = Decoder::decode($exception->getResponse()->getBody()->getContents());
    }
    ...
});
```

Guzzle Ayarları
===============

[](#guzzle-ayarları)

**Teknasyon\\GuzzleAsyncPool\\Pool** sınıfı ikinci parametresi **GuzzleHttp\\Pool** ayarlarını, üçüncü parametresi ise **GuzzleHttp\\Client** objesini bekler. Guzzle dökümanlarından değişiklik yapmak istediğiniz ayarları bu parametreler ile güncelleyebilirsiniz. En sık kullanılacak olan ayar **concurrency** ayarı. Bu ayar ile aynı anda gönderilecek istek sayısını kısıtlarsınız. Bu ayarı ikinci parametrede istenen dizide belirtmeniz gerekmekte.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1880 days

Total

2

Last Release

1372d ago

Major Versions

1.0 → 2.0.02022-09-27

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11849997?v=4)[Teknasyon](/maintainers/teknasyon)[@Teknasyon](https://github.com/Teknasyon)

---

Top Contributors

[![omerucel](https://avatars.githubusercontent.com/u/28244?v=4)](https://github.com/omerucel "omerucel (4 commits)")[![fustundag](https://avatars.githubusercontent.com/u/841630?v=4)](https://github.com/fustundag "fustundag (1 commits)")

---

Tags

guzzleguzzlehttpsoap

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/teknasyon-guzzle-async-pool/health.svg)

```
[![Health](https://phpackages.com/badges/teknasyon-guzzle-async-pool/health.svg)](https://phpackages.com/packages/teknasyon-guzzle-async-pool)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k34](/packages/neuron-core-neuron-ai)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[dreamfactory/df-core

DreamFactory(tm) Core Components

1652.0k38](/packages/dreamfactory-df-core)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
