Top "Callable" questions

A task that returns a result and may throw an exception.

What happens to a BufferedReader that doesn't get closed within a callable.call?

I have three questions. To explain, I was reviewing someone's code, and noticed BufferedReaders sometimes aren't being closed. Usually, Eclipse …

java eclipse inner-classes bufferedreader callable
How to declare Callable to execute function returning void in Java?

Suppose I would like to run static method foo asynchronously void foo() throws Exception {...} Since foo throws an exception I …

java concurrency future callable
Python 3: Making a str object callable

I have a Python program that takes user input. I store user input a string variable called "userInput". I want …

python string object callable
Callable<Void> as Functional Interface with lambdas

I am just learning about new java8 features. And here is my question: Why is it not allowed to use …

java lambda java-8 void callable
Getting a result in the future?

I'm looking to get a result from a method which can take a while to complete and doesn't actually return …

java asynchronous runnable callable futuretask
Callable lambda expression with argument

I am trying to implement "TaskExecutor" with generics (my first attempt to use generics) and using ExecutorService. Here is my "…

java lambda callable
timeit ValueError: stmt is neither a string nor callable

I played with timeit in Python, got a weird problem. I define a simple function add. timeit works when I …

python callable timeit
Dynamically assigning function implementation in Python

I want to assign a function implementation dynamically. Let's start with the following: class Doer(object): def __init__(self): self.…

python anonymous-function anonymous-methods callable
Unit test succeeds in debug mode but fails when running it normally

Why does my unit test succeed in debug mode but fail when running it normally? public class ExecutorServiceTest extends MockitoTestCase{ …

java multithreading junit future callable
invokeAll() is not willing to accept a Collection<Callable<T>>

I fail to understand why this code won't compile ExecutorService executor = new ScheduledThreadPoolExecutor(threads); class DocFeeder implements Callable<Boolean&…

java executorservice callable