opennars / Narjure

A Clojure implementation of the Non-Axiomatic Reasoning System proposed by Pei Wang.
GNU General Public License v2.0
44 stars 11 forks source link

`concept-creator` should not respond to `from` using `cast!` #26

Closed marotili closed 8 years ago

marotili commented 8 years ago

If the initial cast! to the concept-creator did not origin from a server, the cast! will fail. It also introduces implicit knowledge (that from is the task-dispatcher).

As an alternative, the :create-concept-msg could be changed to a call! and return the concept as a response. The task-dispatcher can then spawn a fiber that calls :create-concept-msg and sends the :task-msg to the return value of the call!

TonyLo1 commented 8 years ago

Don't agree with these points. I have dis-allowed the use of call! in the design. It is a blocking call and really impacts performance (this seems to contradict your point about using blocking calls in your other posts)

It is a common design pattern in actors to return the results of processing to the requesting actor, which is designated as the 'from' ref. This pattern is used in many places in the design.

Your approach is one possibility but I would be concerned about the volume of spawned fibres required to support the volume of concept requests, it could potentially be 10's of thousands per second.

patham9 commented 8 years ago

not an issue.