Preserving Business Data and Logic
Result Queue provides abstraction for managing groups of events asynchronously, and zNet further expands API to reuse application's Data and Business Logic.
Any data type, user defined or system, could be wrapped into an Event and submitted to an Active Queue. Conversely, existing business logic expressed via functions or methods, could be registered on the Active Queue to receive an event of specific type.
Typical zNet Event processing and Function registration steps shown in the figure:
-
Note:
-
Only first 3 steps in the sequence below executed by the programmer, the rest is managed by zNet.
- Register MyFunction
- Register MyReplyHandler
- Generate and Submit MyData Events to the Result Queue
- MyData Events Submitted to Worker Queue for Processing
- Worker Threads pick up MyData Events from the Worker Queue
- Worker Threads invoke Dispatcher to map MyData Events to MyFunction
- Worker Threads invoke MyFunction to process MyData Events
- Update Results to the Result Queue
- Reply Processing Threads pick up Replies from the Result Queue
- Reply Processing Threads invoke Dispatcher to match Replies to MyReplyHandler
- Reply Processing Threads invoke MyReplyHandler to Process MyData Replies