Package

scales.utils

resources

Permalink

package resources

Visibility
  1. Public
  2. All

Type Members

  1. trait CloseOnNeed extends IsClosed

    Permalink

    Mostly exists for pulling but it is general

    Mostly exists for pulling but it is general

    We want to enable bracketing and a more orderly shutdown of resources from the input streams. Whilst the resource is closed automatically its not very helpful if you don't want to close it. Due to Sun bug: 6539065 we have to wrap the actual close. This allows us to decide IF we want to close.

    So we cover three use cases here: * Enumeratees can bracket, if so desired * Streams of xml can be continuously plied for more xml messages * Users who want to manually close early can do so too.

    As a note this fits very closely to the scala-arm stuff, which I happily use in another project. But it has two specific seperate use cases: * XmlPulls should be joinable as iterators ++ should ensure that the resources are closed * Additionally, however, closing on the resulting XmlPull should close the lot.

    So we either override the ++ to behave differently or we abstract away using of the stream from closing it.

  2. trait Creator[T] extends AnyRef

    Permalink

    Simple factory interface

  3. trait IsClosed extends AnyRef

    Permalink
  4. trait Loaner[T] extends AnyRef

    Permalink
  5. trait Pool[T] extends AnyRef

    Permalink

    Simple pool interface

  6. trait SimpleUnboundedPool[T] extends Pool[T] with Loaner[T] with Creator[T]

    Permalink

    Thread safe unbounded pool, if more objects are required it will simple create them.

    Thread safe unbounded pool, if more objects are required it will simple create them. The optional parameter reduceSize tries to help clean up a bit when an excessive amount is created but does not act as a semaphore

Ungrouped