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

com.microsoft.azure.servicebus.WorkItem Maven / Gradle / Ivy

/*
 * Copyright (c) Microsoft. All rights reserved.
 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
 */
package com.microsoft.azure.servicebus;

import java.time.*;
import java.util.concurrent.*;

public class WorkItem
{
	private final TimeoutTracker tracker;
	private final CompletableFuture work;

	public WorkItem(final CompletableFuture completableFuture, final Duration timeout)
	{
		this(completableFuture, TimeoutTracker.create(timeout));
	}

	public WorkItem(final CompletableFuture completableFuture, final TimeoutTracker tracker)
	{
		this.work = completableFuture;
		this.tracker = tracker;
	}

	public TimeoutTracker getTimeoutTracker()
	{
		return this.tracker;
	}

	public CompletableFuture getWork()
	{
		return this.work;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy