Module Java.util.Concurrent

Java classes from package java.util.concurrent

Imports

Table of Content

Definitions

data RejectedExecutionException = pure native java.util.concurrent.RejectedExecutionException

Thrown when a task is submitted to an ExecutorService that was shut down or whose queue is full.

data BlockingQueue e = native java.util.concurrent.BlockingQueue

Member Functions

addMutableIO (BlockingQueue e)eIO Bool
native add  throws IllegalStateException

add element to blocking queue, throw exception if not possible

offerMutableIO (BlockingQueue e)eIO Bool
native offer

add element to blocking queue, return false if not possible

pollMutableIO (BlockingQueue e)IO (Maybe e)
native poll

get and remove element from blocking queue, return null if it is empty

putMutableIO (BlockingQueue e)eIO ()
native put  throws InterruptedException

add element to blocking queue, block until possible

removeMutableIO (BlockingQueue e)IO e
native remove  throws NoSuchElementException

get and remove element from blocking queue, throw exception if it is empty

takeMutableIO (BlockingQueue e)IO e
native take  throws InterruptedException

get and remove element from blocking queue, block until something is available

data ArrayBlockingQueue e = native java.util.concurrent.ArrayBlockingQueue

Member Functions

newIntSTMutable RealWorld (ArrayBlockingQueue e)
     | IntBoolSTMutable RealWorld (ArrayBlockingQueue e)
native new

Creates an ArrayBlockingQueue with the given (fixed) capacity and the specified access policy.

If the Bool argument is missing, the default access policy is used. If it is true then queue accesses for threads blocked on insertion or removal, are processed in FIFO order; otherwise the access order is unspecified.

The capacity must be greater than 0, otherwise an IllegalArgumentException is thrown.

new𝖆IntSTMutable RealWorld (ArrayBlockingQueue e)
native new  overloads new

Creates an ArrayBlockingQueue with the given (fixed) capacity and the specified access policy.

If the Bool argument is missing, the default access policy is used. If it is true then queue accesses for threads blocked on insertion or removal, are processed in FIFO order; otherwise the access order is unspecified.

The capacity must be greater than 0, otherwise an IllegalArgumentException is thrown.

new𝖇IntBoolSTMutable RealWorld (ArrayBlockingQueue e)
native new  overloads new

Creates an ArrayBlockingQueue with the given (fixed) capacity and the specified access policy.

If the Bool argument is missing, the default access policy is used. If it is true then queue accesses for threads blocked on insertion or removal, are processed in FIFO order; otherwise the access order is unspecified.

The capacity must be greater than 0, otherwise an IllegalArgumentException is thrown.

data ExecutorService = native java.util.concurrent.ExecutorService

The Java executor service interface.

Member Functions

executorService()STMutable RealWorld ExecutorService
native frege.run.Concurrent.executorService

The default executor service of the Frege runtime

isShutdownMutableIO ExecutorServiceIO Bool
native isShutdown

Tells if this executor has been shut down.

isTerminatedMutableIO ExecutorServiceIO Bool
native isTerminated

Tells if all tasks have completed after ExecutorService.shutdown.

shutdownMutableIO ExecutorServiceIO ()
native shutdown

Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.

submitMutableIO ExecutorServiceMutableIO RunnableIO ()
native submit  throws RejectedExecutionException

Submit a Runnable for execution.

Note that unlike in Java, no Future is returned.

Instances

instance Exceptional RejectedExecutionException

Member Functions

javaClassClass RejectedExecutionException
pure native java.util.concurrent.RejectedExecutionException.class

Functions and Values by Type

MutableIO ExecutorServiceMutableIO RunnableIO ()

ExecutorService.submit

MutableIO ExecutorServiceIO ()

ExecutorService.shutdown

MutableIO ExecutorServiceIO Bool

ExecutorService.isTerminated, ExecutorService.isShutdown

()STMutable RealWorld ExecutorService

ExecutorService.executorService

Class RejectedExecutionException

Exceptional_RejectedExecutionException.javaClass

MutableIO (BlockingQueue e) → e → IO ()

BlockingQueue.put

MutableIO (BlockingQueue e) → e → IO Bool

BlockingQueue.add, BlockingQueue.offer

MutableIO (BlockingQueue e) → IO (Maybe e)

BlockingQueue.poll

MutableIO (BlockingQueue e) → IO e

BlockingQueue.take, BlockingQueue.remove

IntBoolSTMutable RealWorld (ArrayBlockingQueue e)

ArrayBlockingQueue.new𝖇

IntSTMutable RealWorld (ArrayBlockingQueue e)

ArrayBlockingQueue.new𝖆

ω

ArrayBlockingQueue.new

Valid HTML 4.01 Strict