Changeset 32760 in project


Ignore:
Timestamp:
09/02/15 15:51:16 (4 years ago)
Author:
svnwiki
Message:

Anonymous wiki edit for IP [127.0.0.1]: updates from readme.md

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/gochan

    r31982 r32760  
    44fifo queues that are useful in concurrency and for thread
    55synchronization. This implementation has largely been inspired by
    6 [[https://gobyexample.com/channels|this Go channel tutorial]]. Source code can be found [[https://github.com/Adellica/chicken-gochan|here]].
     6[[https://gobyexample.com/channels|this Go channel tutorial]].
    77
    8 
    9 === Requirements
    10 * [[http://api.call-cc.org/doc/srfi-18|srfi-18]]
     8chicken-gochan has no egg dependencies.
    119
    1210
     
    2624
    2725=== API
    28 <procedure> (make-gochan)</procedure>
     26<procedure> (gochan [item1] [item2] ...)</procedure>
    2927
    30 Construct a {{gochan}} record. Each gochan holds a buffer whose length
    31 is limited by memory only.
     28Construct a {{gochan}} channel initialized with optional items. Each
     29gochan holds a buffer whose length is limited by memory only.
    3230
    3331<procedure> (gochan-send chan msg)</procedure>
     
    5250message is received only once).
    5351
    54 <procedure> (gochan-receive* chans [timeout/seconds])</procedure>
     52<procedure> (gochan-receive* chans timeout/seconds)</procedure>
    5553
    5654Like {{gochan-receive}}, but doesn't error out. Instead, it returns:
    5755{{#f}} for all channels closed, {{#t}} for timeout and {{(list <msg>)}} on
    58 success.
     56success (distinguishable from a {{#f}} or {{#t}} message).
    5957
    6058<procedure> (gochan-close chan)</procedure>
     
    8179gochans differently. Used as in [[http://golang.org/|Go]], typically:
    8280
    83 <enscript highlight="scheme">   
     81<enscript highlight="scheme">
    8482(gochan-select
    8583 (chan1 msg (error "from c1" msg))
     
    9593See {{./tests/worker-pool.scm}} for a port of
    9694[[https://gobyexample.com/worker-pools|this Go example]].
    97 
Note: See TracChangeset for help on using the changeset viewer.