Skip to content

An extension of cl-async for introducing 'interval' feature.

License

Notifications You must be signed in to change notification settings

fukamachi/as-interval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

As Interval

This library provides an 'interval' feature for cl-async.

NOTE: This library had merged into cl-async v0.5.4.

Usage

(as:with-event-loop ()
  (let ((event (asi:interval (lambda ()
                               (princ "Hi!"))
                             :time 3)))
    (as:delay (lambda () (asi:remove-interval event))
              :time 10)))

API

[Function] (interval fn &key time event-cb)

Sets an interval callback. This returns an interval-event which can be used for remove-interval.

See also as:delay.

[Function] (with-interval (seconds) &body body)

Syntax wrapper around interval to make it a bit less annoying to type.

(with-interval (5)
  (format t "Five seconds passed! See you soon!~%"))

[Function] (remove-interval interval-event)

Cancels repeated action which was set up using interval.

(let ((event (interval (lambda () (format t "Hi!")) :time 3)))
  (remove-interval event))

Copyright

Copyright (c) 2014 Eitaro Fukamachi ([email protected])

License

Licensed under the MIT License.

See Also

About

An extension of cl-async for introducing 'interval' feature.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published