You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of 8d11ad7, the object returned by aleph.http/start-server cannot be printed (usually at the REPL, but ofc a possibility in other contexts) without blocking, until the server is closed. Not a problem, but perhaps surprising, and maybe tricky to track down if e.g. someone happens to put a server object in a map or something which then gets logged.
I see a couple of options. An IPending impl could be added to the reified object, like:
Gets the job done, but not really in the spirit of IPending, realized?, etc. The more principled and functional approach would be to swap out IDeref for IBlockingDeref; this would fix the printing problem, and also let (uh, force?) people using the deref-to-wait-for-server-close feature avail themselves of a timeout. The only downside AFAICT is that you couldn't just @server to wait. The equivalent would be (deref server Long/MAX_VALUE nil).
The text was updated successfully, but these errors were encountered:
Balls, I forgot about auto deref on print. Let me think about this a bit
more.
On Wed, May 4, 2016 at 3:10 AM Chas Emerick notifications@github.com
wrote:
As of 8d11ad7 8d11ad7,
the object returned by aleph.http/start-server cannot be printed (usually
at the REPL, but ofc a possibility in other contexts) without blocking,
until the server is closed. Not a problem, but perhaps surprising, and
maybe tricky to track down if e.g. someone happens to put a server object
in a map or something which then gets logged.
I see a couple of options. An IPending impl could be added to the reified
object, like:
Gets the job done, but not really in the spirit of IPending, realized?,
etc. The more principled and functional approach would be to swap out
IDeref for IBlockingDeref; this would fix the printing problem, and also
let (uh, force?) people using the deref-to-wait-for-server-close feature
avail themselves of a timeout. The only downside AFAICT is that you
couldn't just @server to wait. The equivalent would be (deref server
Long/MAX_VALUE nil).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub #246
As of 8d11ad7, the object returned by
aleph.http/start-server
cannot be printed (usually at the REPL, but ofc a possibility in other contexts) without blocking, until the server is closed. Not a problem, but perhaps surprising, and maybe tricky to track down if e.g. someone happens to put a server object in a map or something which then gets logged.I see a couple of options. An
IPending
impl could be added to the reified object, like:Gets the job done, but not really in the spirit of
IPending
,realized?
, etc. The more principled and functional approach would be to swap outIDeref
forIBlockingDeref
; this would fix the printing problem, and also let (uh, force?) people using the deref-to-wait-for-server-close feature avail themselves of a timeout. The only downside AFAICT is that you couldn't just@server
to wait. The equivalent would be(deref server Long/MAX_VALUE nil)
.The text was updated successfully, but these errors were encountered: