Documentation ¶
Overview ¶
Package caching is used for copying gopher2600 data so it can be used by the GUI goroutine safely.
To update the cache the following form should be used:
PushFunction(func() { cache.Update(img.vcs) }) if !cache.Resolve() { return }
The PushFunction() function indicates that the cache.Snapshot() function is run in the gopher2600 emulation goroutine. The PushFunction() function itself is run in the GUI routine.
The cache.Resolve() function is run in the GUI goroutine. A return value of false indicates that the cache is not ready to be used.
History ¶
The caching package is a development of the now removed lazy package. The lazy package worked on a similar principle but was inflexible. It predated the development of the rewind package and performed much of the functionality of the rewind "Snapshot" concept in an adhoc manner. Now that the rewind package exists the caching pacakge repurposes the Snapshot() implementations for its own needs
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache contains the copied/snapshotting compenents of the emulated system
func NewCache ¶
func NewCache() Cache
NewCache is the preferred method of initialisation of the Cache type