Is any one actually using PHP generators in their projects?

This page summarizes the projects mentioned and recommended in the original post on /r/PHP

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • collection

    A (memory) friendly, easy, lazy and modular collection class. (by loophp)

  • Interesting, I will read all of this carefully and see how it could be useful for https://github.com/loophp/collection !

  • etl

    PHP - ETL (Extract Transform Load) data processing library (by flow-php)

  • We are dealing with so many imports/syncs with external systems that half of the project is currently based on Generators/Iterators. It's all nicely packed inside of https://github.com/flow-php/etl in order to provide common interface and unified developer experience. This ETL is nothing more than an abstraction yielding Rows through the whole pipeline. It helps us to deal with many popular file/api formats, like JSON, CSV, XML We have following use cases for generators/itsrators:

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Fregata

    Fregata - a PHP database migrator

  • I am using generators in my data migration framework Fregata.

  • php-caching-generator

    A rewindable PHP Generator class that caches its generated values.

  • aphiria

    A simple, extensible REST API framework for PHP

  • I use them as a micro-optimization in my router. Whenever I find a potential matching route, I yield return it and check it against constraints, eg does the HTTP verb match. This way, I don't have to grab all potential route matches prior to checking constraints.

  • Tukio

    A complete and robust implementation of the PSR-14 EventDispatcher specification.

  • Tukio, my PSR-14 library, has a number of examples you can look at. The code base is fairly small. Or see: https://github.com/Crell/Tukio/search?q=yield

  • Iter

    Iteration primitives using generators

  • Yes. We used it heavily when processing large amounts of data from huge API responses. I like how the whole processing chain can be built on top of it, for example using nikic/iter. Generators are also the heart of a low-memory JSON parsing library halaxa/json-machine, which I maintain, and many other similar projects.

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • JSON Machine

    Efficient, easy-to-use, and fast PHP JSON stream parser

  • Yes. We used it heavily when processing large amounts of data from huge API responses. I like how the whole processing chain can be built on top of it, for example using nikic/iter. Generators are also the heart of a low-memory JSON parsing library halaxa/json-machine, which I maintain, and many other similar projects.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • PHP Map v2.6 - Collections made easy

    3 projects | /r/PHP | 25 Jan 2022
  • PHP Map - PHP arrays and collections made easy

    3 projects | /r/PHP | 24 Nov 2021
  • 📚 How to see what changed in Composer files

    2 projects | dev.to | 17 May 2024
  • Using Arbitrary Precision In PHP

    2 projects | dev.to | 10 May 2024
  • PHP: testing, "Attention please!"

    1 project | dev.to | 1 May 2024