async_invocation
Return value for async method that is accidentally invoked synchronously
Usage
Return the AsyncInvocation::Incorrect
from a method that is expected to be called asynchronously and thus is not expected to have a return value.
def some_method
AsyncInvocation::Incorrect
end
result = some_method
# Any method invoked on the result will raise an error
result.any_method
# => AsyncInvocation::Incorrect::Error (Incorrect invocation of async operation. Intended use is invocation with a block argument. Results should be ignored.)
License
The async_invocation
library is released under the MIT License.