A no-arg sibling of java.util.function.Block ?

Sam Pullara spullara at gmail.com
Tue Dec 11 13:37:01 PST 2012


We could add the same default method to Runnable in JDK8 to fix that.

Sam

On Dec 11, 2012, at 1:36 PM, Dmitry Bessonov <dmitry.bessonov at oracle.com> wrote:

> A limitation to mention - Runnables can not be easily chained while Blocks can be...
> 
> -Dmitry
> 
> On 12.12.2012 1:28, Sam Pullara wrote:
>> I always thought of Block as Runnable with an argument and have used Runnable for tasks like this in JDK 6. YMMV.
>> 
>> "The Runnable interface should be implemented by any class whose instances are intended to be executed by a thread."
>> 
>> It will actually be executed by a thread and in a parallel case it may even be a different thread. I'm ok ideologically with using it.
>> 
>> Sam
>> 
>> On Dec 11, 2012, at 1:24 PM, Dmitry Bessonov <dmitry.bessonov at oracle.com> wrote:
>> 
>>> On 12.12.2012 1:09, Sam Pullara wrote:
>>>> Runnable should work for that, no?
>>> Technically - yes.
>>> But (... after reading spec for Runnable) - would that be a good use of Runnable interface from ideological point of view?
>>> 
>>> -Dmitry
>>> 
>>>> Sam
>>>> 
>>>> On Dec 11, 2012, at 1:00 PM, Dmitry Bessonov <dmitry.bessonov at oracle.com> wrote:
>>>> 
>>>>> Hello,
>>>>> 
>>>>> I cannot find a standard interface that will allow me to basically wrap
>>>>> a delayed operation that requires no input objects.
>>>>> 
>>>>> In other words is there a j.u.f.Block but without necessity to supply
>>>>> input object?
>>>>> 
>>>>> (Sorry if such standard interface exists already)
>>>>> 
>>>>> -Dmitry
>>>>> 
> 



More information about the lambda-dev mailing list