rsb.filter

Contains filters which can be used to restrict the amount of 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
MethodFilter(method[, invert]) Matching events have (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)

Matches 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

Parameters:
  • cause – The id of the Event that should be in the cause vector of matching events.
  • invert (bool) – Controls whether matching results should inverted (i.e. matching events that do not have the specified event id in their cause vector).
getCause()
getInvert()
match(event)

Matches this filter against a given event.

Parameters:event – event to match against
Returns:True if this filter matches the event, else False
cause
invert
class rsb.filter.FalseFilter

Bases: rsb.filter.AbstractFilter

match(event)

Matches 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.MethodFilter(method, invert=False)

Bases: rsb.filter.AbstractFilter

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

Code author: jmoringe

Parameters:
  • method (str) – The method string that matching events have to have in their method field.
  • invert (bool) – Controls whether matching results should inverted (i.e. matching events not having method in their method field).
getInvert()
getMethod()
match(event)

Matches this filter against a given event.

Parameters:event – event to match against
Returns:True if this filter matches the event, else False
invert
method
class rsb.filter.OriginFilter(origin, invert=False)

Bases: rsb.filter.AbstractFilter

Matching events have to originate at a particular participant.

Code author: jmoringe

Parameters:
  • origin – The id of the Participant from which matching events should originate.
  • invert (bool) – Controls whether matching results should inverted (i.e. matching events not originating form origin).
getInvert()
getOrigin()
match(event)

Matches this filter against a given event.

Parameters:event – event to match against
Returns:True if this filter matches the event, else False
invert
origin
class rsb.filter.RecordingFalseFilter

Bases: rsb.filter.AbstractFilter

match(event)

Matches 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)

Matches 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

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

Parameters:scope – top-level scope to accept and al child scopes
getScope()

Returns the top-level scope this filter matches for.

Returns:scope
match(event)

Matches 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.TrueFilter

Bases: rsb.filter.AbstractFilter

match(event)

Matches this filter against a given event.

Parameters:event – event to match against
Returns:True if this filter matches the event, else False