Giter Club home page Giter Club logo

pueue's Introduction

Scrutinizer Quality Score Scrutinizer Build Scrutinizer Quality Score

Pueue - PHP Simple Queue

Pueue, is a flexible PHP library for managing queues. It currently supports AWS SQS and plans to extend support to Database and Redis queues. It provides an easy-to-use API for sending, receiving, and deleting messages.

Installation

with Composer:

composer require burak-sevinc/pueue  

Usage

First, you need to create a Queue instance. You can use the QueueFactory for this:

    use BurakSevinc\Pueue\QueueFactory;
    $queue = QueueFactory::create($queueUrl);  

Then, you can create a QueueService instance with the Queue instance:

    use BurakSevinc\Pueue\QueueService;
    $queueService = new QueueService($queue);  

Now you can use the QueueService to interact with the queue:

    // Send a message  
    $queueService->send('Hello, world!');  
      
    // Receive a message  
    $message = $queueService->receive();  
      
    // Receive all messages  
    $messages = $queueService->receiveAll();  
      
    // Delete a message  
    $receiptHandle = $message['receiptHandle'];
    $queueService->delete($receiptHandle);  
      
    // Delete all messages  
    $queueService->deleteAll();  

Configuration

The QueueFactory uses the Config class to get configuration values. You need to set the following configuration values:

    QUEUE_DRIVER: The type of queue to use. Currently, only 'sqs' is supported.  
    AWS_REGION: The AWS region for SqsQueue.  
    AWS_ACCESS_KEY_ID: The AWS access key ID for SqsQueue.  
    AWS_SECRET_ACCESS_KEY: The AWS secret access key for SqsQueue.  

Testing

You can run the tests with:

    composer test

License

Pueue is open-sourced software licensed under the MIT license.

pueue's People

Contributors

burak-sevinc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.