Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Fork on permanent channel #58

Closed
pepijndevos opened this issue Feb 22, 2013 · 0 comments
Closed

Fork on permanent channel #58

pepijndevos opened this issue Feb 22, 2013 · 0 comments

Comments

@pepijndevos
Copy link

(use 'lamina.viz 'lamina.core)

(def server-out (permanent-channel))
(def ch1 (channel))
(def ch2 (channel))
(map* inc (filter* odd? ch1))
(map* inc (filter* odd? ch2))

(defn watch [ch]
  (receive-all (fork ch) println))

(watch server-out)
(siphon server-out ch1)
(view-graph server-out)

;      || receive-all |println|
; || < 
;      || siphon || - ||odd?|| - |inc| - {}

(close ch1)
(siphon server-out ch2)
(view-graph server-out)

; || - || receive-all |println|
; ||

When I close a forked part of a permanent channel, I can no longer siphon that channel into anything else.

A little context about what I'm doing:

I'm making an IRC bouncer by having two permanent channels representing the server. I then siphon the server TCP connection into these. I do the same thing again when the server disconnects.

There are a few forked channels that log the server and respond to ping commands.

When a client connects, I siphon its channels into the server as well. This works like a charm and sends the queued up messages to the client as well.

However, the second time the client connects, it can only send to the server, the server response is never siphoned to the client channel.

My test case simulates the second connect, where the second graph shows the first deleted connection and the complete absence of the second one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants