Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ben Sima
    @bsima
    I'm thinking about swaping out stuartsierra's component library for hara.component
    and I if do that much, then I might as well go full Hara :)
    Really liking the look of hara.event, too
    Chris Zheng
    @zcaudate
    hahaha =) great! it shouldn't be too much work
    Roberto Guerra
    @uris77
    Hi, I'm trying to understand error handling in hara. I don't understand what the second arguments for options are in this example:
    (raise :error
           (option :use-nil [] nil)
           (option :use-custom [n] n)
           (default :use-custom 10))
    what are [] and [n] ?
    Chris Zheng
    @zcaudate
    @uris77: :use-nil and :use-custom are actually function
    s
    so (option :use-custom [n] n) is equivalent to (fn use-custom [n] n)
    and default selects which function to use when there are no handlers
    so the above statement will output 10
    unless you have a manage block that rewrites how the :error is to be run
    Didier A.
    @didibus
    Does concurrent.ova use locks for concurrency? What kind of performance does it have? Say I were to Inc an ova with 3000000 calves in it?
    3000000 values*
    Chris Zheng
    @zcaudate
    I'm not sure if that is a good idea
    but again, it depends on the use case.
    I would say it handles around 10000 elements... but honestly, I would look at a different approach if you needed 30M elements
    ova does lock... it's an array of maps. the array is a ref as is each of the maps
    I wouldn't want to generate 30M refs in my program because that's not what it's designed for
    Didier A.
    @didibus
    Ok,thanks for the answers. I was trying to see for what use case it could be appropriate. I'm liking hara, loving the quality documentation for it.
    Chris Zheng
    @zcaudate
    @didibus: cheers!
    Roberto Guerra
    @uris77
    how would you do something like clj-time's to-sql-time in hara.time?
    you can coerce anything just specify the type to java.sql.Timestamp
    Roberto Guerra
    @uris77
    thanks
    does anyone have any good suggestion for logging patterns? We have a relatively small clojure application whose requirements is to log everystep in a process. It has proven very helpful for reporting, monitoring and troubleshooting. All the logs are shipped as json to logstash.
    the problem we are facing is that the code is now looking very ugly with so many log statements
    I've been reading about conditional systems (and hara.event) in an attempt to try to come up with a solution that will clean up our code. I'm just curious if anyone has had a similar challenge.
    Ben Sima
    @bsima
    @uris77 maybe ask yourself why you need so many calls to log? I've found that refactoring my code to use clear, simple functions and simple abstractions makes it so I don't need so many logging calls
    Roberto Guerra
    @uris77
    It is a requirement for this case. If it were up to me I wouldn't log so much. But in this case it is a requirement, even considered a feature by the client.
    They use the logs to generate reports for monitoring and other things. They are happy with it, and removing logs will upset them. The downside is that the code looks horrible.
    Chris Zheng
    @zcaudate
    @uris77 I see logs as a kind of a side effect so anything that deals with that should be fine. How are you currently doing it?
    Roberto Guerra
    @uris77
    currently we are using timbre and just logging at the source . For example, when we execute an action we log that the action is being executed and the data/state it is acting on. When it completes we log the result. When there is an exception, we log inside the catch block. I imagine event sourcing also has similar challenges.
    Chris Zheng
    @zcaudate
    @uris77: yeah... so I guess one advantage of using hara.event is that you can set a global listener:
    (deflistener print-listener :log
      event
      (log event))
    so that everytime you want to log it, you just go (signal (assoc <data> :log true)) or (raise (assoc <excep> :log true))
    and it will be logged
    it's really bring that catch block outside
    so that it can be globally managed
    Didier A.
    @didibus
    I'd have a look at the
    I'd have a look at the dire library: https://github.com/MichaelDrogalis/dire. Maybe you can do somewhat the same with hara.event, but dire might be easier and simpler for just logging. It's a kind of AOP, you can just say before x,y,z function do this, and after do that. So it's great for logging before and after functions. If you need logging inside function, at a more granular level though, you're our of luck. Either factor your functions in a lot of smaller ones, or I think you're stuck having to throw in a normal log line.
    Roberto Guerra
    @uris77
    Thanks, that looks promising
    vk-
    @vk-
    @zcaudate Heads up, the support link at http://docs.caudate.me/hara/ leads to https://gitter.com/zcaudate/hara instead of https://gitter.im/zcaudate/hara
    vk-
    @vk-
    @zcaudate specifically, the link at the bottom of the left nav menu
    Chris Zheng
    @zcaudate
    @vk-: thanks!
    will update
    Ben Sima
    @bsima
    has anyone used hara.event/manage as ring middleware?
    i'm not sure it's possible...
    or even desirable, now that I think about it
    Dominic Monroe
    @SevereOverfl0w

    On the docs, the table of contents font seems very small. This looks like it's by design. Same for the author tags too.

    Rest of text looks okay though.