Posted to tcl by bairui at Sun Feb 14 06:35:40 GMT 2016view pretty

#! /usr/bin/env tclsh
# Code from apn

package require promise

set promises [lmap path $argv {promise::pexec du -sk $path}]

set all_done [promise::all $promises]

$all_done then [promise::lambda {outputs} {
  foreach output $outputs {puts $output}
} ]

Comments

Posted by apn at Sun Feb 14 11:54:17 GMT 2016 [text] [code]

Try this $all_done then [promise::lambda {outputs} { foreach output $outputs {puts $output} }] [promise::lambda {error_message error_dictionary} { puts $error_message }] and see if it tells you anything. Also NOTE you must have the event loop running (e.g. wish or if in tclsh, a vwait or similar)