com.gh.bmd.jrt.android.builder.AndroidRoutineBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jroutine-android Show documentation
Show all versions of jroutine-android Show documentation
Parallel programming on the go
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gh.bmd.jrt.android.builder;
import com.gh.bmd.jrt.android.routine.AndroidRoutine;
import com.gh.bmd.jrt.builder.RoutineBuilder;
import com.gh.bmd.jrt.builder.RoutineConfiguration;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
* Interface defining a builder of routines bound to a context lifecycle.
*
* Routine invocations started through the returned objects can be safely restored after a change in
* the configuration, so to avoid duplicated calls and memory leaks. Be aware, though, that the
* invocation results will always be dispatched in the main thread, no matter the calling one was,
* so, waiting for the outputs right after the routine invocation, will result in a deadlock.
* The local context of the invocations will always be the application one.
*
* Note that the equals()
and hashCode()
methods of the input parameter
* objects might be employed to check for clashing of invocations or compute the invocation ID.
* In case the caller cannot guarantee the correct behavior of the aforementioned method
* implementations, a user defined ID or the ABORT_THAT
clash resolution should be used
* to avoid unexpected results.
*
* Created by davide on 12/9/14.
*
* @param the input data type.
* @param