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 2mo 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 60% 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

1321d ago

Major Versions

1.0 → 2.0.02022-09-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/e58dd08a2f1ba99ab0c1539dd799ca43061814342f92dc1e34969a610ebf4f06?d=identicon)[teknasyon](/maintainers/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

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

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