google / promises

Promises is a modern framework that provides a synchronization construct for Swift and Objective-C.
Apache License 2.0
3.8k stars 293 forks source link

all() with a generic tuple containing 4 types #61

Closed EthanLozano closed 6 years ago

EthanLozano commented 6 years ago

The all() function currently supports tuples with up to 3 different types. Does it make sense to have an all() function that supports tuples with up to 4 types? I realize that if 4 types are supported, then someone might ask for 5 types! So, I understand if this request is denied.

As a workaround, I'm composing all within all, which isn't pretty: all(promise1, all(promise2, promise3, promise4)). FYI, though I'm using 4 promises, my code rarely (if ever) makes 4 I/O requests due to caching.

shoumikhin commented 6 years ago

Hi Ethan, we do welcome pull requests :) I think 4 or even 5 values for ‘all’ should be fine.