Shinmera / deeds

Deeds is an Extensible Event Delivery System
http://shinmera.github.io/deeds/
zlib License
23 stars 4 forks source link

Questions about the usage of deeds. #5

Closed sakurawald closed 2 days ago

sakurawald commented 2 days ago

Hello, i am using the library deeds, it's well degisned, and almost fit my need. However, i have some question that i still don't understand:

Question 1: what is the difference between message-event and payload-event? Since there is no type for a place in common lisp, the variable has no type, and only the data has type. So it seems that i can use the message-event to delivery any type of data that takes 1 slot. image

Question 2: Is there a convenient way to delivery keyword arguments conveninently? In other words, i would like something like

(do-issue person-add-event :name "alice" :age 12)

Or i have to pack the keyword arguments into one structure (maybe alist or plist), and pass this structure as :payload instead.

Shinmera commented 2 days ago

The documentation for message-event says:

A simple event merely used to deliver message strings.

Whereas a payload-event can deliver any type of object.

Typically you'll define event subclasses that define what values are valid and potentially also perform some kind of validation on them. If you want an unstructured approach, you could indeed use a payload-event and just pass a plist as a payload or whatever.

sakurawald commented 2 days ago

The documentation for message-event says:

A simple event merely used to deliver message strings.

Whereas a payload-event can deliver any type of object.

Typically you'll define event subclasses that define what values are valid and potentially also perform some kind of validation on them. If you want an unstructured approach, you could indeed use a payload-event and just pass a plist as a payload or whatever.

Thank you~