Skip to content

Custom function within parallelMap()?  #34

Description

@jeffbotw

How to call custom php function?

<?php

require __DIR__ . '/vendor/autoload.php';

use function Amp\ParallelFunctions\parallelMap;
use function Amp\Promise\wait;


function myTestFunction($str){
    //returns test
    return substr($test, 0, -1); 
}

$responses = wait(parallelMap([
    'test1',
    'test2',
    'test3',
], function ($str) {
    return myTestFunction($strt);
}));


var_dump($responses); 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions