rsb.filter

Contains filters which can be used to restrict the events received by clients.

Code author: jwienke

Code author: jmoringe

Classes

AbstractFilter

Interface for concrete filters.

CauseFilter(cause[, invert])

Filter events based on their cause vectors.

FalseFilter

FilterAction

An enumeration.

MethodFilter(method[, invert])

Match events do (not) have a particular value in their method field.

OriginFilter(origin[, invert])

Matching events have to originate at a particular participant.

RecordingFalseFilter()

RecordingTrueFilter()

ScopeFilter(scope)

A filter to restrict the scope for events.

TrueFilter

class rsb.filter.AbstractFilter

Bases: object

Interface for concrete filters.

Code author: jwienke

match(event)

Match this filter against a given event.

Parameters

event – event to match against

Returns

True if this filter matches the event, else False

class rsb.filter.CauseFilter(cause, invert=False)

Bases: rsb.filter.AbstractFilter

Filter events based on their cause vectors.

Code author: jmoringe

Create a new instance.

Parameters
  • cause – The id of the Event that should be in the cause vector of matching events.

  • invert – Controls whether matching results should inverted (i.e. matching events that do not have the specified event id in their cause vector).

Type invert

bool

match(event)

Match this filter against a given event.

Parameters

event – event to match against

Returns

True if this filter matches the event, else False

property cause
property invert
class rsb.filter.FalseFilter

Bases: rsb.filter.AbstractFilter

match(event)

Match this filter against a given event.

Parameters

event – event to match against

Returns

True if this filter matches the event, else False

class rsb.filter.FilterAction

Bases: enum.Enum

An enumeration.

ADD = 1
REMOVE = 2
UPDATE = 3
class rsb.filter.MethodFilter(method, invert=False)

Bases: rsb.filter.AbstractFilter

Match events do (not) have a particular value in their method field.

Code author: jmoringe

Create a new instance.

Parameters
  • method – The method string that matching events have to have in their method field.

  • invert – Controls whether matching results should inverted (i.e. matching events not having method in their method field).

Type method

str

Type invert

bool

match(event)

Match this filter against a given event.

Parameters

event – event to match against

Returns

True if this filter matches the event, else False

property invert
property method
class rsb.filter.OriginFilter(origin, invert=False)

Bases: rsb.filter.AbstractFilter

Matching events have to originate at a particular participant.

Code author: jmoringe

Create a new instance.

Parameters
  • origin – The id of the Participant from which matching events should originate.

  • invert – Controls whether matching results should inverted (i.e. matching events not originating form origin).

Type invert

bool

match(event)

Match this filter against a given event.

Parameters

event – event to match against

Returns

True if this filter matches the event, else False

property invert
property origin
class rsb.filter.RecordingFalseFilter

Bases: rsb.filter.AbstractFilter

match(event)

Match this filter against a given event.

Parameters

event – event to match against

Returns

True if this filter matches the event, else False

class rsb.filter.RecordingTrueFilter

Bases: rsb.filter.AbstractFilter

match(event)

Match this filter against a given event.

Parameters

event – event to match against

Returns

True if this filter matches the event, else False

class rsb.filter.ScopeFilter(scope)

Bases: rsb.filter.AbstractFilter

A filter to restrict the scope for events.

Code author: jwienke

Construct a new scope filter with a given scope to restrict to.

Parameters

scope – top-level scope to accept and al child scopes

match(event)

Match this filter against a given event.

Parameters

event – event to match against

Returns

True if this filter matches the event, else False

property scope

Return the top-level scope this filter matches for.

Returns

scope

class rsb.filter.TrueFilter

Bases: rsb.filter.AbstractFilter

match(event)

Match this filter against a given event.

Parameters

event – event to match against

Returns

True if this filter matches the event, else False