Feature #1425

Implement framework-level event transformations

Added by J. Moringen about 11 years ago. Updated about 11 years ago.

Status:ResolvedStart date:02/19/2013
Priority:NormalDue date:
Assignee:J. Moringen% Done:

100%

Category:Common Lisp
Target version:rsb-0.9

Description

The idea is to transform events
  • in informer: after submission by client but before sending
  • in handler/reader: after receiving but before dispatching
This mechanism will be useful for implementing:
  • Scope rewriting
  • Timestamp adjustments (e.g. in RSBag)

Related issues

Blocks Robotics Service Bus - Tasks #889: Scope renaming [Common Lisp] New 02/16/2012
Blocks RSBag - Feature #1423: Allow timestamp adjustments for the remote-controlled rep... Resolved 02/19/2013
Blocks RSBag - Bug #1091: Replaying to different channel does not work Resolved 07/20/2012

Associated revisions

Revision 7745b382
Added by J. Moringen about 11 years ago

Added event transform mechanism in src/event-processing/*.lisp

fixes #1425

The change basically adds the `rsb.event-processing:transform!'
protocol, support in all participant classes, functions and macros and
unit tests.

  • src/event-processing/conditions.lisp: new file; contains conditions
    used by the event-processing module
  • src/event-processing/protocol.lisp (header): updated copyright
    (transform!): new generic function; destructively transform an event
    (transform! :around t t): new method; translate conditions and
    establish restarts
    (transform! t t): new method; signal an error
    (transform! function t): new method; call the provided function
    (transform! sequence t): new method; apply all transforms in the
    sequence
  • src/event-processing/processor-mixins.lisp: new file; contains
    processor mixins; `transform-mixin' for now
  • src/event-processing/configurator.lisp (header): updated copyright
    (configurator::transform): new slot; stores the transform which
    should be applied to events
    (shared-initialize :after configurator t): pass transform to
    `make-processor' if necessary
    (collect-processor-mixins append configurator): add
    `transform-mixin' if necessary
  • src/event-processing/package.lisp (header): updated copyright
    (package rsb.event-processing): added exported symbols
    transform-error, transform-error-transform, transform-error-object,
    transform!, configurator-transform, transform-mixin and
    processor-transform
  • src/protocol.lisp (make-listener): added transform keyword
    parameter; extended documentation string accordingly
    (make-reader): likewise
    (make-informer): likewise
  • src/participant.lisp (header): updated copyright
    (participant::transform): new slot; stores the transform which
    should be applied to processed events
    (make-participant): added transform parameter; updated documentation
    string accordingly
    (define-participant-creation-uri-methods): likewise
  • src/informer.lisp (make-informer t t): likewise
  • src/listener.lisp (header): updated copyright
    (make-listener scope): added transform parameter
  • src/reader.lisp (header): updated copyright
    (make-reader scope): added transform parameter
  • src/macros.lisp (header): updated copyright
    (define-with-participant-macro): added transform parameter
  • src/package.lisp (header): updated copyright
    (package rsb): added exported symbol participant-transform
  • src/patterns/types.lisp (header): updated copyright
    (transform-specification): new type; transform specification syntax
    for servers
  • src/patterns/protocol.lisp (header): updated copyright
    (make-remote-server): added transform keyword parameter; extended
    documentation string accordingly
    (make-local-server): likewise
  • src/patterns/server.lisp (header): updated copyright
    (define-lazy-creation-method): added transform parameter; controls
    which transform should be installed into the created participant;
    adapted documentation string accordingly
    (server::transform): restrict type to `transform-specification'
    (shared-initialize :before server t): check type of transform
    parameter
  • src/patterns/local-server.lisp (header): updated copyright
    (define-lazy-creation-method local-method listener): added transform
    specification
    (define-lazy-creation-method local-method informer): likewise
    (make-local-server): added transform keyword parameter
  • src/patterns/remote-server.lisp (header): updated copyright
    (define-lazy-creation-method remote-method listener): added transform
    specification
    (define-lazy-creation-method remote-method informer): likewise
    (make-remote-server): added transform keyword parameter
  • test/event-processing/protocol.lisp: new file; contains unit tests
    for function of the event-processing protocol; `transform!' for now
  • test/event-processing/processor-mixins.lisp: new file; contains unit
    tests for processor mixin classes; only `transform-mixin' for now
  • test/event-processing/package.lisp (header): updated copyright
    (package rsb.event-processing.test): added used packages alexandria
    and let-plus
    (mock-processor): new class; mock class for processor mixin tests
    (handle mock-processor t): new method; record function calls
  • test/informer.lisp (header): updated copyright
    (define-basic-participant-test-cases :informer): added a case which
    specifies a transform
  • test/listener.lisp (define-basic-participant-test-cases :listener):
    likewise
  • test/reader.lisp (header): updated copyright
    (define-basic-participant-test-cases :reader): added a case which
    specifies a transform
  • test/patterns/server.lisp (test server-root::construction): new
    test; test constructing `server' instances with valid and invalid
    initargs
  • test/patterns/integration/lisp (header): updated copyright
    (test integration-root::transform): new test; test applying
    transforms between `remote-server' and `local-server'
  • cl-rsb.asd (system cl-rsb): added files
    src/event-processing/conditions.lisp and
    src/event-processing/processor-mixins.lisp
    (system cl-rsb-test): added files
    test/event-processing/protocol.lisp and
    test/event-processing/processor-mixins.lisp

History

#1 Updated by J. Moringen about 11 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset rsb-cl|commit:7745b382162506707af6feaf8d718df7c51b7161.

Also available in: Atom PDF