|
|
|
|
|
by delano
6179 days ago
|
|
Interesting! I'm not familiar with KiokuDB or Moose so I hope you don't mind a couple questions: - what is the return value of $self->data in the example you link to? - do you store the digest or calculate it each time? - where can I find an example of the digests being used? I looked around the repo a bit but couldn't find one. |
|
The digest is only calculated when the object is stored. When it is retrieved and stored again (a no-op, since it's immutable), the ID is remembered and not recalculated. (Creating an identical new object will result in the digest being calculated again, of course.)
The basic pattern for using this, once you've written the class:
Then this is true (the linker keeps note of the in-memory object IDs):