Rice Pastry API

rice.environment.processing
Interface Processor

All Superinterfaces:
Destructable
All Known Implementing Classes:
SimpleProcessor, SimProcessor, UnifiedProcessor

public interface Processor
extends Destructable

Provides a mechanism to do time consuming tasks off of FreePastry's selecto thread. Usually acquired by calling environment.getProcessor().

Author:
Jeff Hoye

Method Summary
 void destroy()
          Shuts down the processing thread.
<R,E extends java.lang.Exception>
Cancellable
process(Executable<R,E> task, Continuation<R,E> command, int priority, SelectorManager selector, TimeSource ts, LogManager log)
          Schedules a job for processing on the dedicated processing thread.
<R,E extends java.lang.Exception>
Cancellable
process(Executable<R,E> task, Continuation<R,E> command, SelectorManager selector, TimeSource ts, LogManager log)
          Schedules a job for processing on the dedicated processing thread.
 Cancellable processBlockingIO(WorkRequest request)
          Schedules a different type of task.
 

Method Detail

process

<R,E extends java.lang.Exception> Cancellable process(Executable<R,E> task,
                                                      Continuation<R,E> command,
                                                      SelectorManager selector,
                                                      TimeSource ts,
                                                      LogManager log)
Schedules a job for processing on the dedicated processing thread. CPU intensive jobs, such as encryption, erasure encoding, or bloom filter creation should never be done in the context of the underlying node's thread, and should only be done via this method. The continuation will be called on the Selector thread.

Parameters:
task - The task to run on the processing thread
command - The command to return the result to once it's done

process

<R,E extends java.lang.Exception> Cancellable process(Executable<R,E> task,
                                                      Continuation<R,E> command,
                                                      int priority,
                                                      SelectorManager selector,
                                                      TimeSource ts,
                                                      LogManager log)
Schedules a job for processing on the dedicated processing thread. CPU intensive jobs, such as encryption, erasure encoding, or bloom filter creation should never be done in the context of the underlying node's thread, and should only be done via this method. The continuation will be called on the Selector thread. Passes a priority that will be respected if possible.

Parameters:
priority - lower number is higher priority, 0 is default priority, and negative numbers are high priority
task - The task to run on the processing thread
command - The command to return the result to once it's done

processBlockingIO

Cancellable processBlockingIO(WorkRequest request)
Schedules a different type of task. This thread is for doing Disk IO that is required to be blocking.

Parameters:
request -

destroy

void destroy()
Shuts down the processing thread.

Specified by:
destroy in interface Destructable

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection