Selector resources.

Primary

deregister!

Available since version 1.0 (view source)

Usage:
  • (deregister! selector resource)

Type signature:
  • (SelectorResource ⨯ ISelectable) → nil

Deregisters a resource from selector. Returns nil.

See also: register!, select, selector

register!

Available since version 1.0 (view source)

Usage:
  • (register! selector resource)

  • (register! selector resource interests)

  • (register! selector resource interests user-map)

Type signatures:
  • (SelectorResource ⨯ ISelectable) → nil

  • (SelectorResource ⨯ ISelectable ⨯ IRed) → nil

  • (SelectorResource ⨯ ISelectable ⨯ IRed ⨯ {}) → nil

Registers a resource with selector, using interests collection of keywords as an interest set. May supply user-map which will be returned by the selector when the resource will be ready for one of given interest operations. Returns nil. Throws when resource is not in non-blocking mode.

Supported interest operations are host specific. JVM defines following interest operations:

  • :any - watch for any operation

  • :read - resource is ready for reading

  • :write - resource is ready for writing

  • :accept - resource is ready to accept a connection

  • :connect - resource has been successfully connected.

select

Available since version 1.0 (view source)

Usage:
  • (select selector)

  • (select selector timeout)

Type signatures:
  • (SelectorResource) → Integer+

  • (SelectorResource ⨯ (U nil Integer+ IDuration)) → Integer+

Returns number of ready resources among ones registered within selector. Blocks until some resources are ready or until timeout is reached.

select-now

Available since version 1.0 (view source)

Usage:
  • (select-now selector)

Type signature:
  • (SelectorResource) → Integer+

Returns number of ready resources among ones registered within selector. Returns immediatelly.

See also: select, selector, register

selector

Available since version 1.0 (view source)

Usage:
  • (selector & {:as opts})

Type signature:
  • (Any) → IAcquirableFactory

Returns a selector factory with given opts set.

See also: select, register!

selector-factory

Available since version 1.0 (view source)

not referred automatically

VAR of type IAcquirableFactory

Selector resource factory.

Other

In this section: deregister* register*

deregister*

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (deregister* selector resource ch)

Type signature:
  • (SelectorResource ⨯ ISelectable ⨯ java.nio.channels.SelectableChannel) → nil

A helper function that deregisters given channel ch from selector.

See also: deregister!

register*

Available since version 1.0 (view source)

not referred automatically

Usage:
  • (register* selector resource interests user-map ch)

Type signature:
  • (SelectorResource ⨯ ISelectable ⨯ IRed ⨯ {} ⨯ java.nio.channels.SelectableChannel) → nil

A helper function that registers given host selectable channel ch within selector with given interests and user-map.

See also: register!