Skip to content

Custom function within parallelMap()?  #34

@jeffbotw

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); 

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