Top Description Inners Fields Constructors Methods
org.jruby.ext.thread

public Class SizedQueue

extends Queue
Class Inheritance
Annotations
@JRubyClass
name:SizedQueue
parent:Queue
Imports
org.jruby.Ruby, .RubyClass, .RubyHash, .RubyNumeric, .RubyThread, org.jruby.anno.JRubyClass, .JRubyMethod, org.jruby.ast.util.ArgsUtil, org.jruby.runtime.ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject, java.util.concurrent.TimeUnit, java.util.concurrent.atomic.AtomicInteger, java.util.concurrent.locks.ReentrantLock

The "SizedQueue" class from the 'thread' library.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private final RubyThread.Task<IRubyObject, IRubyObject>
Inherited from org.jruby.ext.thread.Queue:
capacityclosedcountheadlastnotEmptynotFullputLocktakeLock

Constructor Summary

AccessConstructor and Description
protected
SizedQueue(Ruby runtime, RubyClass type)

public
SizedQueue(Ruby runtime, RubyClass type, int max)

Method Summary

Modifier and TypeMethod and Description
public synchronized IRubyObject
public RubyNumeric
max(ThreadContext context)

public synchronized IRubyObject
public RubyNumeric
protected boolean
public boolean
offerInternal(ThreadContext context, IRubyObject e, long timeout, TimeUnit unit)

public IRubyObject
public IRubyObject
push(ThreadContext context, final IRubyObject arg0, final IRubyObject nonblockOrOpts)

public IRubyObject
push(ThreadContext context, final IRubyObject arg0, final IRubyObject _nonblock, IRubyObject _opts)

public IRubyObject
push(ThreadContext context, final IRubyObject[] argv)
Deprecated

private IRubyObject
pushCommon(ThreadContext context, IRubyObject arg0, boolean nonblock, long timeoutNS)

public static RubyClass
setup(ThreadContext context, RubyClass Thread, RubyClass Queue, RubyClass Object)

Inherited from org.jruby.ext.thread.Queue:
checkShutdownclearclearInternalcloseclosed_pcloseInternalcreateInterruptedErrordequeueempty_penqueuefreezefullyLockfullyUnlockinitializeinitializedCheckinitializedCheckisShutdownjava_lengthlengthmarshal_dumppollInternalpollInternalpoppoppopputInternalqueueTimeoutToNanosraiseClosedErrorsetupsetupErrorshutdownsignalNotEmptysignalNotFulltakeInternal

Field Detail

blockingPutTaskback to summary
private final RubyThread.Task<IRubyObject, IRubyObject> blockingPutTask

Constructor Detail

SizedQueueback to summary
protected SizedQueue(Ruby runtime, RubyClass type)
SizedQueueback to summary
public SizedQueue(Ruby runtime, RubyClass type, int max)

Method Detail

initializeback to summary
public synchronized IRubyObject initialize(ThreadContext context, IRubyObject arg)

Overrides org.jruby.ext.thread.Queue.initialize.

Annotations
@JRubyMethod
name:initialize
visibility:PRIVATE
maxback to summary
public RubyNumeric max(ThreadContext context)
Annotations
@JRubyMethod
max_setback to summary
public synchronized IRubyObject max_set(ThreadContext context, IRubyObject arg)
Annotations
@JRubyMethod
name:max=
num_waitingback to summary
public RubyNumeric num_waiting(ThreadContext context)

Overrides org.jruby.ext.thread.Queue.num_waiting.

Annotations
@JRubyMethod
offerInternalback to summary
protected boolean offerInternal(ThreadContext context, IRubyObject e)
offerInternalback to summary
public boolean offerInternal(ThreadContext context, IRubyObject e, long timeout, TimeUnit unit) throws InterruptedException
pushback to summary
public IRubyObject push(ThreadContext context, final IRubyObject arg0)

Overrides org.jruby.ext.thread.Queue.push.

Annotations
@JRubyMethod
name:push, <<, enq
pushback to summary
public IRubyObject push(ThreadContext context, final IRubyObject arg0, final IRubyObject nonblockOrOpts)
Annotations
@JRubyMethod
name:push, <<, enq
pushback to summary
public IRubyObject push(ThreadContext context, final IRubyObject arg0, final IRubyObject _nonblock, IRubyObject _opts)
Annotations
@JRubyMethod
name:push, <<, enq
pushback to summary
public IRubyObject push(ThreadContext context, final IRubyObject[] argv)

Deprecated

Annotations
@Deprecated
pushCommonback to summary
private IRubyObject pushCommon(ThreadContext context, IRubyObject arg0, boolean nonblock, long timeoutNS)
setupback to summary
public static RubyClass setup(ThreadContext context, RubyClass Thread, RubyClass Queue, RubyClass Object)
org.jruby.ext.thread back to summary

private final Class SizedQueue.BlockingOfferTask

extends Object
implements RubyThread.Task<IRubyObject, IRubyObject>
Class Inheritance
All Implemented Interfaces
org.jruby.RubyThread.Task, org.jruby.RubyThread.Unblocker

Field Summary

Modifier and TypeField and Description
private final long

Constructor Summary

AccessConstructor and Description
public
BlockingOfferTask(long timeoutNS)

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

timeoutNSback to summary
private final long timeoutNS

Constructor Detail

BlockingOfferTaskback to summary
public BlockingOfferTask(long timeoutNS)

Method Detail

runback to summary
public IRubyObject run(ThreadContext context, IRubyObject value) throws InterruptedException

Implements org.jruby.RubyThread.Task.run.

Annotations
@Override
wakeupback to summary
public void wakeup(RubyThread thread, IRubyObject sizedQueue)

Implements org.jruby.RubyThread.Task.wakeup.

Annotations
@Override