All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gradle.process.internal.worker.MultiRequestWorkerProcessBuilder Maven / Gradle / Ivy

There is a newer version: 8.6
Show newest version
/*
 * Copyright 2016 the original author or authors.
 *
 * 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 org.gradle.process.internal.worker;

import org.gradle.api.Action;
import org.gradle.internal.serialize.Serializer;

/**
 * Configures and builds multi-request workers. A multi-request worker runs zero or more requests in a forked worker process.
 *
 * 

This builder produces instances of type {@link MultiRequestClient}. Each call to {@link MultiRequestClient#run(Object)} on the returned object will run the method in the worker and block until the result is received. * Any exception thrown by the worker method is rethrown to the caller. * *

The worker process executes the request using an instance of the implementation type specified as a parameter to {@link WorkerProcessFactory#multiRequestWorker(Class)}.

* *

The worker process must be explicitly started and stopped using the methods on {@link WorkerControl}.

*/ public interface MultiRequestWorkerProcessBuilder extends WorkerProcessSettings { /** * Creates a worker. * *

The worker process is not started until {@link WorkerControl#start()} is called on the returned object.

*/ MultiRequestClient build(); /** * Registers a callback to invoke if a failure in an underlying process is detected. */ void onProcessFailure(Action action); /** * Registers a serializer to use when handling arguments to methods of {@link T}. */ void registerArgumentSerializer(Class type, Serializer serializer); /** * Use a simpler classloader structure where everything is in the application classloader. */ void useApplicationClassloaderOnly(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy