2017 © Pedro Peláez
 

library crimp

A dead simple multi curl implementation, optimized for high concurrency

image

xpaw/crimp

A dead simple multi curl implementation, optimized for high concurrency

  • Sunday, May 27, 2018
  • by xPaw
  • Repository
  • 1 Watchers
  • 14 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Crimp Packagist

A simple multi curl implementation, optimized for high concurrency., (*1)

This is practically a bare bones implemention. Retrying, HTTP code checking and other stuff is up to the user., (*2)

Usage:, (*3)

$Crimp = new Crimp( function( CurlHandle $Handle, string $Data, $Request ) : void
{
    // $Handle is the cURL handle
    // $Data is the content of a cURL handle
    // $Request is whatever was queued
} );

// How many concurrent threads to use
$Crimp->Threads = 10;

// Set any curl option that are needed
$Crimp->CurlOptions[ CURLOPT_FOLLOWLOCATION ] = 1;

// Queue urls
$Crimp->Add( 'https://example.com/?v=1' );
$Crimp->Add( 'https://example.com/?v=2' );

// Queue an array, it must contain a `Url` key
$Crimp->Add( [ 'Url' => 'https://example.com/?v=3' ] );

// Queue an object, it must contain a `Url` property
class RequestUrl { public string $Url; }
$request = new RequestUrl();
$request->Url = 'https://example.com/?v=4';
$Crimp->Add( $request );

// Execute the requests
$Crimp->Go();

CURLOPT_RETURNTRANSFER is enabled by default. See examples folder for more., (*4)

If you need a fully featured multi cURL implemention, take a look at Zebra_cURL or Guzzle instead., (*5)

The Versions

27/05 2018

dev-master

9999999-dev https://github.com/xPaw/Crimp.php

A dead simple multi curl implementation, optimized for high concurrency

  Sources   Download

MIT

The Requires

  • php >=5.4
  • lib-curl *

 

curl async

17/06 2016

1.0.0

1.0.0.0 https://github.com/xPaw/Crimp.php

A dead simple multi curl implementation, optimized for high concurrency

  Sources   Download

MIT

The Requires

  • php >=5.4
  • lib-curl *

 

curl async