Fork me on GitHub

any one know an more lightweight alternative to slingshot? I know that it exists but I don't remember the name 😞


clj-webdriver: why show me the login page even if I have already logined in and let the site remember me? Since I already signed in manually, if I close the web, and reopen the web again manually, it doesn't let me login again. So I hope if I use clj-webdriver, it also doesn't need me login in again. But it actually ask me to sign in. I am using (set-driver! {:browser :firefox} some_url_need_sign_in). Is there any parameter to control whether to used the saved cookie?

Pablo Fernandez09:09:11

My Clojure app needs to run another program and keep a reference to it and if for some reason it’s not running (crashed or whatever), it needs to restarted. Should I use Runtime.exec and put the result in an atom so that it’s accessible by all threads?


@pupeno: does the Clojure program need to do that? The reason I ask is that there are lots of mature tools for monitoring processes and restarting them already

Pablo Fernandez09:09:35

@danielcompton: I want my library to be as self contained as possible and my library needs to run nodejs. Not running nodejs would be a big abstraction leakage. It’s not the end of the world, but it will make the library much less useful.

Pablo Fernandez09:09:46

@danielcompton: BTW, I do the devops for my company, I wrote the init script for rails/unicorn, solr, many delayed jobs, I am familiar with that side of things too, I’m not avoiding it because I don’t know it; I think it’d be a poor design for my lib.


Ok, no problem. I don't remember the details, but I seem to recall there being dragons with running external processes from the JVM. Someone more knowledgable can speak to that though.

Alex Miller (Clojure team)09:09:17

the Java APIs for this stuff are pretty bad

Alex Miller (Clojure team)09:09:53

there are some clojure libs that clean up access though

Pablo Fernandez09:09:15

I’m looking at

Alex Miller (Clojure team)09:09:32

not sure if that's still maintained

Pablo Fernandez09:09:22 blocks while it’s running, which is not what I want unless I dedicate a thread to it, which… doesn’t sound like a good approach. At least, not an approach I ever took before.

Alex Miller (Clojure team)10:09:47

dedicating a thread may be inevitable

Pablo Fernandez10:09:59

This is something I observed in Clojure… some libraries are so small that lack of activity is not lack of maintenance but the fact that the library is pretty much done. Compared to other programming languages, in Clojure, it sometimes harder to know whether to use a library or not.

Pablo Fernandez10:09:39

alexmiller: conch looks cool, but it’s still blocking.

Alex Miller (Clojure team)10:09:59

the java apis give you streams that you are expected to read

Alex Miller (Clojure team)10:09:40

so you will almost definitely have to consume a thread reading that stream


Any way to tell at runtime what multimetod dispatch values are implemented?


@alexmiller: nice, thanks; I've already figured out why the method is not getting registered, but it will come in handy for the future.


@pupeno: I haven't used this myself, but maybe it'll suit your needs.


It doesn't block, and it gives you access to stdin/stdout/stderr streams.


@pupeno: take a look to the "low level" api of conch. You'll find it in the readme that way. It gives you access to the streams too


@nberger: yeah! Seems it is! Thanks!


Hi, I'm a newbie and am trying to use the stuartsierra.component framework. I'm confused as to how I use components that I've created. For example. Here we have the function upload-receipt. But where would this upload-receipt function be called from / who would be passing the uploader and receipt params here?


I am still fighting heavily with using lazy sequences, nested in a large tree and avoiding head retention issues. Maybe some of you would like to have a look at my SO question: Any help is highly appreciated!


@timfield: e.g. when you have compojure routes you can get Uploader injected into your context then you can dispatch upload-receipt with this record. I have similar example in my repo


in clojure/west example that would be:

(defn example-endpoint [{uploader :uploader}]
    (POST "/" [receipt]
      (response (upload-receipt uploader receipt))))))


Hello, is anyone aware of a boot template for both clojure and clojurescript ?

Pablo Fernandez18:09:56

bidi seems to think /about and /about? are different routes 😕


pjagielski: nice job. fills a niche for sure.


I believe the clojure answer to JPA and korma is Don't: Bad/Antiquated/Broken idea.


And many clojure answers to java are simply: use the java library.


Hmm, what's the motivation between Spring Data -> system mapping? As far as I understand system that's just a collection of component components and Spring Data seems like some meta-ORM from the description.


how sequential are squuids? If I were to sort a million squuids, would they be perfectly ordered by timestamp?


nvm. turns out I’m using clj-uuid/v1, which includes clj-uuid/get-timestamp


I'm developing an API, and realizing that after I log in, I don't know how to test that my identity is on the session without just hitting a resource that requires authentication (or creating a "current-account" route specifically for this purpose).


To be more exact: 1. Visit the login route, supplying credentials. 2. Test that response status is 200. 3. Test that response body is a JSON representation of the user who just logged in. 4. Test that the app will remember me on my next request...


Number 4 is where I'm getting hung up. For now, I'll just do the most obvious thing, and make a current-account route which returns info on the logged-in user. Nothing wrong with that... it just seems like a very black-box approach. But since sessions live at the request/response level, I don't know how to test them anywhere else.


(I have a hazy idea of how to test middlewares, by passing in Ring requests, but I don't know exactly how to craft the lower-level requests that would test this situation. All I really want to do is make sure my login handling code added the right stuff to the session!)


@jaen: system provides connectors to both jdbc and nosql datastores, this is what spring-data can be used for. however i consider adding a "notes" column with some additional information


@amacdougall: use, and hit request another URL that will only work if you’re logged in?


@arohner: Yep, that's what I'm going to do! I just switched from ring.mock.request to peridot for that reason.


I was hoping to test the exact keys added to the session by my login route, but it seems like I might have to test it only implicitly. Which is honestly not a huge deal.


I’m pretty sure you can access the session in peridot


though i guess that depends on which session store you’re using


you can definitely access the cookies


Oh, interesting. I'll dig deeper. Thanks!


Hi. Is there way to maintain own suite of modules, e.g. as common part for series of projects, like [my.organization.module-foo 1.0.0] and have them on some server?


sounds like you need your own maven repository


thanks, but I believe my task is somehow simpler simple_smile but I don't know how exactly


last time I checked, it wasn’t too complicated


you can always keep them in your local repo, vide lein help install