<    April 2017    >
Su Mo Tu We Th Fr Sa  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
00:12 jkreeftmeijer joined
00:16 steffkes joined
00:20 milad joined
00:40 codestorm joined
00:43 cschneid_ joined
00:45 Ven joined
00:46 Reshi joined
00:48 sevenseacat joined
00:51 fowlduck joined
00:52 Uniaika joined
00:59 nighty-- joined
01:02 rodolfojcj joined
01:04 chrismccord joined
01:08 fernandomm joined
01:08 proteusguy joined
01:13 rodolfojcj joined
01:14 kblake joined
01:19 bionj joined
01:23 chavito joined
01:31 wong2 joined
01:34 cschneid_ joined
01:34 codestorm joined
01:37 duane joined
01:38 tomterl joined
01:40 NeverDie joined
01:41 claudevandort joined
01:51 refriedchicken joined
01:52 fowlduck joined
01:52 mischov joined
01:56 raycoll joined
01:59 iCharlie joined
02:03 refriedchicken joined
02:03 milad joined
02:04 sfbw joined
02:10 mwbrown joined
02:14 jkreeftmeijer joined
02:14 raycoll joined
02:15 kblake joined
02:16 steffkes joined
02:16 steffkes joined
02:17 codestorm joined
02:19 nomicflux joined
02:24 lessless joined
02:27 kotedo joined
02:27 duane joined
02:28 <kotedo> Hi ! How can I create a HTML template from the command line that references another table? Like: The Project belongs to user xyz?
02:28 <kotedo> Oh, that's a Phoenix Question ... ^^^
02:29 nahtnam joined
02:32 wong2 joined
02:40 kotedo joined
02:40 <kotedo> /?
02:41 <asonge> kotedo: why would this be in the template?
02:41 bionj joined
02:42 <asonge> (i'd also not expect the generators to do everything, they're supposed to be a guide, you're not supposed to be able to generate arbitrarily complex apps)
02:45 <kotedo> asonge: What I am looking for is a way to specify relations upon generation from the command line using mix
02:47 <kotedo> asonge: Hmmm, I thought I has seen a reference of sorts
02:47 <sevenseacat> +1 to 'generators won't do everything for you'
02:48 <kotedo> sevenseacat: :) Okay ... if not the generators, but what about the migrations?
02:48 <sevenseacat> what about them?
02:49 <kotedo> sevenseacat: There gotta be a way (besides the models) to specify relations, or not?
02:49 <sevenseacat> if you want to set up foreign keys, the migration is the right place to do it
02:49 lessless joined
02:50 <sevenseacat> or indexes, or other database-level things
02:50 <kotedo> sevenseacat: Yes, that would be the goal. Do you have a reference by any chance?
02:50 <sevenseacat> https://hexdocs.pm/ecto/Ecto.Migration.html#content
02:51 <asonge> (references is for the foreign keys)
02:52 <kotedo> sevenseacat: Wonderful! Thanks a bunch!
02:52 fowlduck joined
02:53 cschneid_ joined
02:54 <kotedo> asonge: Thank you, too! :)
02:55 <asonge> no problem
02:55 meandi_2 joined
03:03 bionj joined
03:03 racycle joined
03:03 milad joined
03:08 kotedo joined
03:08 <kotedo> sevenseacat: asonge: I found it: mix phoenix.gen.html Project projects user_id:references:users name:string description:string
03:08 <kotedo> That creates the migration file with the proper reference
03:09 <sevenseacat> it does. do remember that the scaffolds are only for learning purposes, though
03:09 <kotedo> :) Yes, indeed!
03:09 <kotedo> sevenseacat: They are a cane to get one going
03:10 <sevenseacat> if I was writing tutorials, I wouldn't use them at all tbh
03:15 elixir-lang626 joined
03:15 kblake joined
03:15 griffinbyatt joined
03:36 bionj joined
03:40 bionj joined
03:48 PhatLe joined
03:53 fowlduck joined
03:57 jerel joined
04:03 milad joined
04:08 milad joined
04:15 jkreeftmeijer joined
04:16 kblake joined
04:17 steffkes joined
04:27 codestorm joined
04:42 PhatLe joined
04:46 cschneid_ joined
04:52 proteusguy joined
04:54 fowlduck joined
05:04 dec0n joined
05:13 codestorm joined
05:22 chrismccord joined
05:29 dignifiedquire joined
05:30 AustinMatherne joined
05:52 codestorm joined
05:53 nd__ joined
05:55 fowlduck joined
05:55 cemilowski joined
05:59 jkreeftmeijer joined
06:00 gvaughn joined
06:12 kotedo joined
06:14 l14n joined
06:18 steffkes joined
06:21 codestorm joined
06:25 kyrix joined
06:30 duane joined
06:31 epochwolf joined
06:31 gregman_ joined
06:33 jkreeftmeijer joined
06:49 tuacker joined
06:56 fowlduck joined
06:57 manukall joined
07:01 mattyw joined
07:06 bionj_ joined
07:07 bionj__ joined
07:09 ZippoWeb2 joined
07:13 m00dy joined
07:13 PhatLe joined
07:13 the_voice- joined
07:14 m00dy_ joined
07:15 m00dy joined
07:15 PaReeOhNos joined
07:17 the_voice- joined
07:17 m00dy joined
07:19 m00dy joined
07:20 bionj joined
07:21 mischov joined
07:22 bionj_ joined
07:24 blahdodo joined
07:27 asabil joined
07:27 bionj joined
07:27 codestorm joined
07:27 mark_66 joined
07:28 PhatLe_ joined
07:30 stephen_m joined
07:30 <m1dnight_> hey guys. Im in need of a way to discover physical web devices (eddystone for example) in erlang
07:31 <m1dnight_> As far as I cna tell there is no library available. But there is one in Node.js for example. What would be the fastest way to get something setup ?
07:31 <m1dnight_> Is there language symbiosis with for example java? then I can abuse that to run the discovery service in java
07:32 <Havvy> Fastest? If you want to use multiple languages, have the programs communicate with each other.
07:34 <m1dnight_> Well, ideally an elixir library would fall from the sky and I'd use that
07:34 <m1dnight_> but this for science stuffs, so it can be hacked together
07:34 <m1dnight_> hence, my solution to use different languages
07:34 <m1dnight_> unless somebody knows of some library that hasn't made it in my google search results :p
07:37 <Havvy> m1dnight_: Would it be easier to rewrite the Node.js library in Elixir or to open an OS socket into a Java program?
07:38 gokr joined
07:39 steffkes joined
07:39 steffkes joined
07:45 dani0_ joined
07:49 gvaughn joined
07:51 tuacker1 joined
07:51 milad joined
07:51 fernandomm joined
07:51 steffkes joined
07:51 steffkes joined
07:53 <m1dnight_> not sure if easier, but might be better quality-wise, though
07:56 fowlduck joined
07:59 craigp_ joined
08:00 dani0_ joined
08:02 cemilowski joined
08:05 dani0_ joined
08:06 akeating joined
08:06 akeating joined
08:11 bionj joined
08:11 lessless joined
08:13 bionj_ joined
08:14 agit0 joined
08:17 nd__ joined
08:19 Guest67_ joined
08:20 josevalim joined
08:20 asabil joined
08:21 <PaReeOhNos> What is the preferred way of writing tests for something that relies on a third party server? The app opens connections to a user configurable server, but not sure how to write tests for this
08:21 codestorm joined
08:23 vmoravec joined
08:24 marr joined
08:28 lessless joined
08:29 Guest67_ joined
08:31 asabil joined
08:37 bionj joined
08:57 fowlduck joined
09:00 m00dy joined
09:02 m00dy joined
09:02 dignifiedquire joined
09:02 cschneid_ joined
09:02 bionj joined
09:05 m00dy joined
09:05 frefity joined
09:07 cschneid_ joined
09:08 m00dy joined
09:14 m00dy joined
09:16 codestorm joined
09:22 jadlr joined
09:22 lexmag joined
09:27 proteusguy joined
09:33 duane joined
09:34 lopex joined
09:35 <micmus> m1dnight_: the simplest way to communicate cross languages is using ports, e.g. http://theerlangelist.com/article/outside_elixir
09:35 <micmus> For Java there's also jinterface http://erlang.org/doc/apps/jinterface/jinterface_users_guide.html
09:37 gvaughn joined
09:38 <micmus> PaReeOhNos: take a look at https://github.com/PSPDFKit-labs/bypass
09:38 <m1dnight_> Well, i think ports might be the best approach
09:38 <m1dnight_> im reading that article now
09:38 <m1dnight_> thanks already :)
09:39 <PaReeOhNos> micmus: cheers, does that support non HTTP connections, things like using :gen_tcp or :ssl?
09:39 mattyw joined
09:39 <micmus> PaReeOhNos: I'm not sure
09:39 lessless joined
09:40 <PaReeOhNos> Will take a look and see if I can get it to work, thanks :)
09:53 codestorm joined
09:58 fowlduck joined
10:04 bionj joined
10:18 gmcabrita joined
10:19 mattyw joined
10:24 <jadlr> In the GenStage streamer is this code: https://github.com/elixir-lang/gen_stage/blob/master/lib/gen_stage/streamer.ex#L48 Is it guaranteed that the {:producer, status} message arrives after the emitted events?
10:26 frefity joined
10:29 squallstter joined
10:30 m00dy joined
10:31 m00dy joined
10:32 <jadlr> to answer my question: Yes it is, since the notify just casts a message to self()
10:38 dani0_ joined
10:40 craigp_ joined
10:43 io_bora joined
10:48 codestorm joined
10:50 greengriminal joined
10:54 akeating joined
10:56 m00dy joined
10:58 m00dy joined
10:59 fowlduck joined
11:00 m00dy joined
11:00 PhatLe joined
11:02 m00dy joined
11:04 akeating joined
11:04 cevado joined
11:07 Siyfion joined
11:07 akeating joined
11:09 renl joined
11:10 <renl> hi I am trying to use Elixir Port to spawn a c++ executate which just printf some lines, it seems the at Elixir it is receiving the printf in huge chunks at a time and is very slow in between am i missing something?
11:12 m00dy joined
11:13 m00dy joined
11:15 m00dy joined
11:15 PhatLe joined
11:18 cschneid_ joined
11:18 milad joined
11:18 milad joined
11:26 gvaughn joined
11:26 claudevandort joined
11:30 dimitarvp joined
11:32 edmaarcosta joined
11:33 m00dy joined
11:36 duane joined
11:37 nighty-- joined
11:38 am55 joined
11:38 bionj joined
11:42 codestorm joined
11:42 griffinbyatt joined
11:42 griffinbyatt joined
11:44 NeverDie_ joined
11:50 asabil joined
11:51 DeadTrickster joined
11:55 johnstorey joined
11:56 jkreeftmeijer joined
11:57 steffkes joined
11:57 steffkes joined
11:59 fowlduck joined
12:02 am55 joined
12:07 dani0_ joined
12:10 cristianR_ joined
12:13 akeating joined
12:13 jkreeftmeijer joined
12:14 mattyw joined
12:15 sfbw joined
12:23 akeating joined
12:28 <gjaldon__> what are your thoughts on running releases or using mix to run your app in prod?
12:29 <Nicd-> releases allow for hot upgrades. IMO releases are the gold standard but personally I have been too lazy to implement them so I'm going `mix phoenix.server` all the way :D
12:29 <gjaldon__> to me, unless hotcode loading is required or we are deploying to a constrained environment (like an embedded device), I think the default should be to use mix in prod instead of releases
12:34 bitmod joined
12:36 codestorm joined
12:36 PhatLe joined
12:39 krelix joined
12:40 duane joined
12:41 <benwilson512> gjaldon__: always use releases, whether using hot upgrades or not
12:42 <benwilson512> it's the only way to eagerly load all the relevant code
12:42 nomicflux joined
12:42 <benwilson512> if you use mix and then start hitting your app with traffic the first several requests will be much slower since mix needs to load all of your code
12:42 <benwilson512> this can cause timeouts and other errors
12:42 akeating joined
12:43 <Nicd-> let them suffer!
12:43 <Nicd-> they were too eager
12:43 <benwilson512> Nicd-: heh
12:43 <gjaldon__> Nicd-: lol :D
12:43 <gjaldon__> benwilson512: I was unaware of that. How come mix does not eagerly load?
12:44 <benwilson512> I mean the way I see it there's just very little reason NOT to use them. You can still have mix around and everything you just also run `mix release` and run the release instead of mix run --no-halt. it's like 1 extra step
12:44 <benwilson512> gjaldon__: because it doesn't know what code you want to use in its totality
12:44 <benwilson512> the only way you know that kind of thing is by building app manifests which....
12:44 <benwilson512> is precisely what a release is
12:45 <Nicd-> I'm a heathen, with a new version I do (with MIX_ENV=prod) `git pull && mix deps.get && mix compile && mix ecto.migrate && mix frontend.build && mix phoenix.digest && systemctl restart mybestwebsite.net`
12:45 <Nicd-> then sometimes I forget something and it's all broken
12:45 <Nicd-> whoops
12:46 <benwilson512> I mean using releases would be the same exact thing you just also add && mix release
12:46 <benwilson512> and your .service file has ./bin/myapp foreground instead of mix run
12:46 <Nicd-> but on the source machine, not the server?
12:46 <benwilson512> you can have it all on the server, that's what I'm saying
12:46 <benwilson512> releases don't mean you HAVE to split up your build and app servers
12:47 <benwilson512> they give you the OPTION to do so but you can just as easily run a release from the same place you built it
12:47 bigkevmcd joined
12:47 <Nicd-> I need to check them out sometime though
12:48 <Nicd-> would love some hot reloads because of my websockets
12:48 <benwilson512> distillery has made the release experience very nice
12:48 <Nicd-> now when I restart the service, my error log is full of people's browsers screaming after their dead sockets :D
12:48 <benwilson512> lol
12:49 <gjaldon__> benwilson512: the thing I didnt like about releases was that they didn’t ‘mix’ well with mix configs. but I guess distillery is much better?
12:49 <benwilson512> honestly proper blue green deployment would work just as well though
12:49 <benwilson512> gjaldon__: the only thing that catches people off guard is that if you do System.get_env in the mix config file it'll be the environment where things are built
12:49 <benwilson512> but all you gotta do is instead of config :foo, System.get_env("FOO") just have
12:49 <benwilson512> config :foo, "%{FOO}"
12:49 <benwilson512> in your prod config, and then REPLACE_OS_VARS=true set when you run the release
12:50 <Nicd-> oh well, I have too much other stuff to do before I get to releases
12:51 <gjaldon__> benwilson512: I see. before being aware of how using mix can cause timeouts, didn’t seem like there was much value in releases outside of hotcode upgrades
12:52 <benwilson512> gjaldon__: they have some other handy attributes like ensuring erlang heart is running, making sure you can remote console in, etc
12:52 <gjaldon__> benwilson512: but I guess that problem of timeouts happening appear only in larger codebases?
12:52 <gjaldon__> benwilson512: ya was thinking remote console is still possible if you run your elixir app with certain options
12:52 <benwilson512> gjaldon__: keep in mind that "large" is a matter of your code + ALL of your dependencies
12:53 <benwilson512> not just your code
12:53 <gjaldon__> benwilson512: and erlang heartbeat doesn’t seem that necessary if you use something like systemd or did I misunderstand its use?
12:53 _bob joined
12:54 <benwilson512> gjaldon__: heart will handle situations if you've managed to lock up your application without actually crashing it
12:54 <benwilson512> as I understand
12:54 <benwilson512> systemd will only know to restart stuff if the OS process dies
12:55 <benwilson512> I guess what i'm saying is, mix is and has never purported to be anything other than Elixir's build tool
12:55 <gjaldon__> benwilson512: I see. any idea what causes lockups? is there no equivalent to erlang heart when using mix?
12:56 io_bora joined
12:56 <benwilson512> gjaldon__: the only way that I know of for lockups that comes to mind is a badly behaving NIF
12:56 <benwilson512> gjaldon__: you can pass the right options to erl when using mix to get heart sure
12:56 <benwilson512> I mean at the end of the day both mix and releases are just passing stuff to the erts runtime
12:56 dani0_ joined
12:57 <benwilson512> I'm just saying one was built as a build tool, and one was written to run production code, and we get nice defaults and optimal behaviour when we use each for what they were built for
12:57 <benwilson512> and the complexity overhead of using releases is basically just 1 additional build command
12:58 <benwilson512> the marginal value to marginal cost ratio is very good
12:59 <gjaldon__> benwilson512: you make good points. it does seem like using releases adds more value than it costs
13:00 chrismccord joined
13:00 fowlduck joined
13:00 <gjaldon__> benwilson512: thanks a lot for the discussion, btw! I learned a lot about releases and finally get why it’s a ‘default’ when shipping to prod :)
13:01 <benwilson512> gjaldon__: no problem! I'm actually gonna start a forum thread on this subject to make sure I'm not missing anything, i'll link it here when I'm done
13:01 <gjaldon__> benwilson512: that’d be great! thanks a lot :D
13:01 jerel joined
13:02 ramortegui joined
13:03 PhatLe joined
13:08 <benwilson512> https://elixirforum.com/t/always-use-releases/4573
13:13 m00dy joined
13:14 gvaughn joined
13:16 m00dy joined
13:18 sfbw joined
13:18 griffinbyatt joined
13:22 johnstorey joined
13:24 io_bora joined
13:24 maxbeizer joined
13:26 lessless joined
13:30 codestorm joined
13:32 akeating joined
13:36 meh` joined
13:36 akeating joined
13:38 <ericmj> benwilson512: ping
13:38 <benwilson512> ericmj: pong
13:39 socketguru joined
13:39 <ericmj> benwilson512: im getting errors from ex_aws when running an application locally
13:39 <benwilson512> gist?
13:39 <benwilson512> and version?
13:39 krelix joined
13:39 akeating joined
13:39 <ericmj> https://gist.github.com/ericmj/51b07dae6995da1a1c829993878a136c
13:40 <benwilson512> what's your config look like?
13:40 <ericmj> v1.1.0
13:40 <benwilson512> that only happens when it can't find your auth keys
13:40 <benwilson512> and it falls back to trying to use the instance meta
13:40 <benwilson512> which obviously won't work locally
13:41 <ericmj> benwilson512: ah, :secret_access_key wasn't set
13:42 <ericmj> thanks
13:42 <benwilson512> ericmj: no problem!
13:42 <ericmj> benwilson512: why is ex_aws making these requests?
13:42 <benwilson512> ericmj: was this happening without making an ExAws calls?
13:42 <ericmj> no, i was probably making ex_aws calls
13:43 <ericmj> i think it would be better to make instancemeta opt-in
13:43 <benwilson512> ericmj: it's an issue of defaults. EVERY other AWS library has a pretty consistent chain of things it tries
13:44 <ericmj> okay, it just feels weird to make requests by default
13:44 <ericmj> i have the same issue with tzdata :)
13:44 <benwilson512> heh
13:44 <benwilson512> I hear you, I'll think about it
13:45 <ericmj> specially bad when the API changes which it did with tzdata, so the application was erroring all the time :(
13:45 mattyw joined
13:46 <benwilson512> ericmj: ah yeah that happened to me too
13:46 <benwilson512> hd([]) or whatever
13:46 <ericmj> yup
13:47 <ericmj> benwilson512: btw, regarding releases on heroku
13:47 <ericmj> there is no benefit of eager loading since heroku will not be accepting requests while you restart your app
13:47 <benwilson512> ericmj: it isn't about accepting requests while your app starts
13:47 <benwilson512> it's that even after your app starts
13:47 <benwilson512> not all the code is up until it's actually used
13:47 junsuijin joined
13:48 <benwilson512> as best I can tell
13:48 <ericmj> yes, but while your app is eager loading it doesn't accept requests
13:48 <ericmj> which is even worse then loading on demand
13:48 <ericmj> unless i misunderstand what eager loading does
13:48 <benwilson512> ericmj: wait, heroku doesn't do blue green deployments?
13:48 <ericmj> :P
13:49 <benwilson512> that'd be an issue with mix too though
13:49 <ericmj> mix doesn't do eager load
13:49 <benwilson512> right exactly
13:49 claudevandort joined
13:49 <benwilson512> hahahahaha ok lets step through the process one sec
13:49 <benwilson512> so with mix you've got v0 running and you want to deploy v1
13:49 <benwilson512> v1 compiles, and boots, and now accepts requests. heroku starts routing traffic to v1
13:49 rodolfojcj joined
13:49 <benwilson512> right?
13:50 <benwilson512> lets say you're using Absinthe just for fun. Prior to any traffic coming in, no code has called Absinthe yet
13:50 <ericmj> nah, v1 compiles, v0 shuts down, v1 starts, v1 gets routed traffic
13:50 <benwilson512> oh, so there's ALWAYS downtime?
13:51 <ericmj> a few seconds yes
13:51 <ericmj> unless you enable preboot
13:51 <benwilson512> yikes
13:51 <ericmj> which has been weird in my experience and much slower deploys
13:51 <ericmj> and really bad if you need hotfix something
13:52 <benwilson512> hm ok
13:52 <ericmj> the other issue is that heroku users would need to add another dependency for the release tool (not a big issue)
13:52 <benwilson512> it seems that there'd be interesting room for some empirical analysis
13:52 <benwilson512> how much actual delay does release eager loading add? not sure
13:52 <ericmj> but release tools has been kind of bad, at least historically
13:52 <ericmj> no idea
13:53 <benwilson512> distillery has worked pretty smoothly for me, but your point WRT load times is interesting
13:53 <ericmj> but i would guess it's about the same as all on-demand loading combined
13:53 <benwilson512> ericmj: depends on your traffic load, I've seen some icky cases with mix
13:53 <benwilson512> if you have dozens of requests a second every request ends up hitting the code server to load code
13:53 <benwilson512> and it isn't done yet
13:54 io_bora joined
13:54 <ericmj> so for me there has been no reason to change the buildpack to use releases, because there were no tangible benefits and i would have to work with release tool issues
13:54 <ericmj> that's a good point
13:54 <benwilson512> ericmj: if any of those requests start async jobs that are supposed to finish in a particular amount of time you can get timeout issues that cause whole application failures in pathological cases
13:55 <benwilson512> you basically have to tune your supervisor max_restarts value for this particular boot issue
13:55 <ericmj> heroku also supports building your slugs locally, if doing that, i would see the use case for using releases
13:55 <ericmj> but the tooling is worse for that
13:55 <ericmj> (imo)
13:56 <benwilson512> gotcha
13:56 <benwilson512> perhaps my choice of Heroku as an example was bad
13:56 <benwilson512> I'm in the middle of working on a nice docker based setup with ECS
13:56 <ericmj> benwilson512: the supervisor restart issue sounds annoying, im glad ive never had to deal with that
13:56 <benwilson512> so far that's going very nicely
13:56 <benwilson512> getting heroku like push button updates but with all the blue green niceness
13:56 <benwilson512> and minimal ops complexity
13:56 <ericmj> at my new place of work we use docker to build locally and dicon to push the release
13:57 <benwilson512> nice yea
13:57 <ericmj> https://hex.pm/packages/dicon
13:57 <ericmj> dicon is not perfect but we are working on improving it
13:57 <ericmj> benwilson512: you are using ecs containers, right?
13:57 <benwilson512> ericmj: that's the plan, it's still in development for us
13:58 <benwilson512> we run more than just Elixir so it would give us a nice homogenous ops experience
13:59 <ericmj> that makes sense
13:59 <benwilson512> whenever Google's cloud gets a production ready managed Postgres I'm gonna look pretty heavily at its kubernetes platform
13:59 <ericmj> let us know how it turns out
13:59 <benwilson512> in my playing around with it it's extremely nice
13:59 <benwilson512> their cloud UI is incredible
14:00 <benwilson512> you can do kubernetes on AWS but it requires an intense amount of orchestration, and having it as a first class feature means I don't have to worry about it
14:00 <ericmj> i want managed redis also, or similar alternative, then i would start looking at google cloud for hex.pm
14:00 akeating joined
14:01 <ericmj> i need to move from heroku for hex.pm anyway
14:01 <benwilson512> their managed job service looks really nice
14:01 fowlduck joined
14:01 <ericmj> or at least move parts from heroku
14:01 <benwilson512> yea
14:02 <benwilson512> I'll let you know how the ECS thing goes
14:02 <benwilson512> we have a staging setup working on it, we hope to move production to it soon
14:02 m00dy joined
14:04 vmoravec joined
14:04 io_bora joined
14:05 InternetFriend joined
14:06 ZippoWeb2 joined
14:07 akeating joined
14:11 gvaughn joined
14:12 NeverDie_ joined
14:14 <cristianR_> Hello
14:18 <cristianR_> We're using a nodejs script to test the websockets scalability. We'd like to close the sockets that fail using the onError callback. However, even after issuing a socket.disconnect(), they keep retrying to reestablish the connection.
14:18 <cristianR_> What would be the proper way of doing this?
14:19 griffinbyatt joined
14:20 <benwilson512> cristianR_: what aspect of the scalability are you trying to test?
14:20 inoas joined
14:20 <cristianR_> we want to measure if our service scales as users connect
14:21 io_bora joined
14:21 <cristianR_> basically, we have a list of online users, we want to simulate the connection of those users
14:21 <benwilson512> ok. have you looked into what the Phoenix team used when they were doing http://www.phoenixframework.org/blog/the-road-to-2-million-websocket-connections?
14:24 <cristianR_> yes, but we need the actual online users ids to establish the websockets. We query the backend using json_rpc for that. I'm not sure we can do that with TSung
14:24 codestorm joined
14:26 drincruz joined
14:27 <benwilson512> gotcha. you could possibly just have pre-established seed data and go with that. in any case though
14:27 <benwilson512> back to your actual question
14:27 bunzz left
14:27 <benwilson512> what's trying to reestablish the connection, your nodejs script?
14:27 <cristianR_> yes
14:28 <cristianR_> We haven't found a way of making the sockets to just stop
14:28 <benwilson512> are you using phoenix js in your node script/
14:28 <benwilson512> I guess I'm trying to figure out what part of this is an elixir / phoenix question vs a nodejs question
14:28 PhatLe joined
14:29 <cristianR_> we are importing phoenix js library into our nodejs script
14:29 <cristianR_> and using that to establish the websocket connections and channel subscriptions
14:30 <cristianR_> that they do work
14:30 <cristianR_> but if I stop the phoenix server, I would like them to just stop instead of trying to reconnect
14:31 <benwilson512> gotcha
14:32 milad joined
14:32 PhatLe_ joined
14:32 <cristianR_> yes
14:33 <benwilson512> if you don't get a rapid response here you could try an issue on whatever project has phoenix.js?
14:34 Stratus3D joined
14:36 <cristianR_> benwilson512: good tip! thank you!
14:39 craigp joined
14:45 jpterry joined
14:48 dani0_ joined
14:49 cdg joined
14:50 racycle joined
14:53 rschmukler joined
14:54 cristianR_ joined
14:55 m00dy joined
14:55 raycoll joined
15:01 potatosalad joined
15:01 fowlduck joined
15:04 fernandomm joined
15:04 codestorm joined
15:04 codestorm joined
15:06 chavito joined
15:06 potatosalad joined
15:11 dani0_ joined
15:12 cschneid_ joined
15:13 potatosalad joined
15:14 bionj joined
15:14 jerel joined
15:20 griffinbyatt joined
15:20 InternetFriend joined
15:21 hashpuppy joined
15:24 gvaughn joined
15:30 NeverDie joined
15:32 ZippoWeb2 joined
15:36 PhatLe joined
15:37 m00dy joined
15:39 mattyw joined
15:40 tuacker joined
15:40 bionj_ joined
15:42 mattyw joined
15:42 jkreeftmeijer joined
15:42 jkreeftmeijer joined
15:43 potatosalad joined
15:45 io_bora joined
15:46 PhatLe joined
15:48 rschmukler joined
15:49 jeffweiss joined
15:50 ejpcmac joined
15:53 cdg_ joined
15:54 davidw joined
15:57 wwwd joined
15:59 rschmukler joined
15:59 kblake joined
16:00 cevado joined
16:01 cdg joined
16:02 kblake joined
16:02 fowlduck joined
16:03 gokr joined
16:07 akeating joined
16:07 akeating joined
16:08 chrismccord joined
16:08 <wwwd> I have a file with a list of colors that I am trying to convert to a list of two-item tuples to be used in a Phoenix select. I'm using file = File.read "file.json" to open the file. I end up with a string where the first char is "[" and every '"' is escaped like '\"'. I used String.slice to pull out the the colors and am trying to use String.replace(string, "\", "") to remove the escape chars. The String.replace command is locking up
16:08 <wwwd> my REPL. So, am I doing something wrong and when I do end up with a locked terminal how do I free it?
16:10 rschmukler joined
16:10 potatosalad joined
16:11 NeverDie_ joined
16:13 <dsimon> wwwd, if it's exactly as you pasted, your terminal might not be locked, but just waiting for a closing quote
16:15 <wwwd> dsimon: What closing quote? I an opening and closing quote with "\" and then an opening and an opening closing quote with the empty string. Is this not allowed?
16:15 MaSven joined
16:17 rschmukl_ joined
16:18 <wwwd> And, I assumed it is waiting for something. But I'm not sure what. So, in this situation is there a way to break out of an incomplete code segment without killing the repl and starting over?
16:20 racycle joined
16:21 griffinbyatt joined
16:21 amclain joined
16:25 ctp joined
16:26 <micmus> wwwd: "\" is not a backslash character, "\\" is. \ escapes in the string, so you're escaping the quote. The shell is waiting for the closing quote.
16:26 <wwwd> Oh, I have to type "\" as "\\" or it is escaping the closing '"'
16:26 <wwwd> Right! Just figured it out...
16:27 cdg joined
16:28 <asonge> just a quick survey, has anyone here had any issues with yarn?
16:28 <wwwd> However, is not removing the escape chars. How would I do this? Or is there a way to open the file so that it does not have every '"' escaped?
16:30 codestorm joined
16:36 <asonge> wwwd: it sounds like you're trying to parse some kind of prompt, and it might be easier to just pattern-match your way instnead of String.slice stuff
16:36 cevado joined
16:40 akeating joined
16:40 akeating joined
16:41 akeating joined
16:51 fowlduck joined
16:54 TinkerTyper joined
16:55 dani0_ joined
16:55 <wwwd> asonge: I'm not sure I'm understanding...Isn't there a way to open a file and parse it's contents? And, what exactly is File.read "file" giving me?
16:55 <asonge> the file's content as bytes. file parsing from erlang-land would be for a file full of erlang terms.
16:57 <wwwd> So it's giving me a byte string?
16:59 <asonge> it's an elixir string of bytes, if that's what you mean
16:59 <asonge> (a binary, technically, and not necessarily a utf8 string)
16:59 chrismccord joined
17:01 <wwwd> So, I don't undersand what you mean by "it sounds like you're trying to parse some kind of prompt". What do you mean I'm trying to parse some kind of prompt. I "think" I'm trying to parse a string...Am I thinking about this whole thing incorrectly?
17:01 <asonge> the data you're reading contains shell escape sequences. you should parse those. it sounds like you were trying to use String.slice to take stuff out
17:03 sfbw joined
17:07 rodolfojcj joined
17:07 icanhazbroccoli joined
17:08 sfbw joined
17:16 sfbw joined
17:18 cevado joined
17:21 griffinbyatt joined
17:22 akeating joined
17:24 inoas joined
17:25 codestorm joined
17:25 wsieroci joined
17:26 refriedchicken joined
17:29 hahuang65 joined
17:32 miwa left
17:33 refriedchicken joined
17:37 sfbw joined
17:37 m00dy joined
17:41 jkreeftmeijer joined
17:43 m00dy joined
17:43 cevado joined
17:45 <dsimon> wwwd, could you perhaps pastebin a section of the file you're reading?
17:45 Cthalupa joined
17:45 gokr joined
17:45 nahtnam joined
17:47 jkreeftmeijer joined
17:50 frefity joined
17:51 io_bora joined
17:55 JuanMiguel joined
17:57 jeffweiss joined
17:58 wsieroci joined
17:59 Cthalupa joined
18:02 cdg joined
18:03 rschmukler joined
18:03 fowlduck joined
18:04 sfbw joined
18:08 milad joined
18:12 lexmag joined
18:19 codestorm joined
18:21 greengriminal joined
18:22 tolerablyjake joined
18:23 griffinbyatt joined
18:24 Gringill joined
18:24 potatosalad joined
18:25 blahdodo joined
18:30 io_bora joined
18:31 imush joined
18:37 codestorm joined
18:40 <OliverMT> what is the semantics of {:global, :some_name} in a phoenix app of two or more nodes on a genserve
18:40 <OliverMT> r
18:40 nd__ joined
18:40 <OliverMT> where do I read or what do I google for?
18:40 <OliverMT> I want at most one genserver running in the cluster
18:41 jkreeftmeijer joined
18:41 <OliverMT> but if a node goes AWOL or similar, the returning nodes should fire up an instance
18:41 jkreeftmeijer joined
18:42 InternetFriend joined
18:42 marcdel joined
18:43 milad joined
18:49 <OliverMT> SO delivers :)
18:49 <OliverMT> http://stackoverflow.com/questions/4459431/erlang-best-way-for-a-singleton-gen-server-in-erlang-cluster
18:49 uamana joined
18:50 chrismccord joined
18:50 <OliverMT> starting it on all nodes and just have some qorum decision on who should be master seems very straight forward
18:51 <benwilson512> OliverMT: what are you gonna go with, the distributed application bit?
18:52 <OliverMT> I answered before you asked, I think :D
18:52 <OliverMT> multi_call on startup, see if a master exists, send a multi_call with a timestamp and a :look_at_me_im_the_captain_now if not
18:53 <OliverMT> resolve races by simply seeing who has lowest timestamp
18:53 <OliverMT> I wish phoenix channels could live without clients
18:53 <benwilson512> hm
18:53 <benwilson512> interesting
18:53 <OliverMT> would be so nice as backchannels for this
18:53 <chrismccord> OliverMT wdym?
18:53 io_bora joined
18:53 <OliverMT> just using presence to resolve stuff
18:54 <OliverMT> basically nodes speaking over channels
18:54 <OliverMT> without sockets
18:54 <OliverMT> without having to implement a websocket phoenix channel client
18:54 <OliverMT> you have like 95% of the api you need
18:54 <chrismccord> OliverMT : you can use phoenix pubsub and presence directly
18:54 <OliverMT> hmm that is true
18:54 <OliverMT> multi_call is so verbose
18:55 <chrismccord> you could also make a channels client that used regular process messaging
18:55 <OliverMT> phoenix presence would work perfectly, simply say you're master and let the presence system handle all confliccts
18:55 <chrismccord> presence is eventually consistent, so it wouldn't be suitable by itself for leader election
18:56 <OliverMT> register yourself to the my:unique:thing:channel and look at the timestamp to decide if you're master or not
18:56 <OliverMT> for my case that is ok
18:56 <OliverMT> dont need strict uniqueness
18:56 <OliverMT> that is one thing I need to figure out, I dont actually know what happens when a node rejoins a cluster
18:56 <chrismccord> gotcha. See the Phoenix.Tracker docs. It's trivial to use directly
18:56 <OliverMT> does previous monitors go back up?
18:57 <OliverMT> or is it considered dead after a :DOWN
18:57 <tristan__> I do similar with eventually consistent registry, but sort all nodes in the cluster and use the first one in the sort as the one to decide who lives
18:57 <chrismccord> OliverMT : all the nodes members would be sent as :leaves in the tracker's handle_diff
18:57 <chrismccord> and the re-upped registrations would come through as new joins
18:58 <OliverMT> and you'd simply get joins
18:58 <OliverMT> indeed
18:58 <OliverMT> so simply see if master leaves and spin up a master if it does
18:58 <tristan__> though I want something different since this depends on having a full mesh, which means depending on dist erlang :(
18:58 <OliverMT> you can do non-full-mesh now?
18:58 <OliverMT> I thought that was slated for R20
18:58 <tristan__> not with dist erlang, no
18:58 <OliverMT> you can speak to other nodes (natively) without disterl?
18:58 <tristan__> but you can just do your own tcp connections
18:59 <OliverMT> oh
18:59 <OliverMT> here be dragons
18:59 <tristan__> no more than the dragons in disterl, hehe
18:59 kyrix joined
19:00 <OliverMT> I have had no dragons so far
19:01 <OliverMT> using bitwalkers libcluster
19:01 <OliverMT> so easy to use
19:02 <tristan__> yea, depends how much it is used. you can start having a bad time due to it using a single connection to send all messages and shit like that very quickly
19:04 potatosalad joined
19:06 <OliverMT> hmm
19:07 <OliverMT> we do all our heavy lifting through phoenix channels
19:07 <OliverMT> if it works crap I'll just shame chrismccord on twitter until he fixes it
19:07 <OliverMT> :D
19:09 <chrismccord> OliverMT : longer term, we have some plans around topology and rpc mechanism outside disterl, so stay tuned
19:09 <OliverMT> my global process is simply to have only one node scour the db to send email notifications
19:10 <OliverMT> I wonder if I can just have all nodes run a select for lock on a status row
19:10 <OliverMT> to say "hey, now I'm doing the email notifcations run"
19:10 <OliverMT> instead of all this global registration stuff
19:15 <tristan__> has there been any movement on that stuff chrismccord
19:15 <chrismccord> OliverMT if your cluster size is fixed, you could shard the notifications by id or something and have N nodes responsible for their own subset
19:16 <tristan__> hoping partisan lib can be utilized so we share in any improvements :)
19:16 <tristan__> and would love to get teleport productionized for message passing through dedicated tcp connections
19:16 <chrismccord> tristan__ : not yet. Some other priorities to take care of first
19:16 <chrismccord> tristan__ : yeah for sure
19:16 <OliverMT> tristan_ you have a different nick on github right?
19:16 <OliverMT> are you tsloughter?
19:16 <tristan__> OliverMT: yea
19:16 <OliverMT> or something similar
19:17 <OliverMT> ah, rang a bell :)
19:17 <OliverMT> you have some libs published iirc
19:18 <tristan__> no elixir libs yet, but yea some erlang libs
19:20 wsieroci joined
19:21 kblake joined
19:25 d10n-work joined
19:25 griffinbyatt joined
19:30 dani0_ joined
19:31 imush joined
19:34 DeadTrickster joined
19:37 ejpcmac left
19:37 icanhazbroccoli joined
19:41 Ioyrie joined
19:43 kblake joined
19:44 gokr joined
19:55 <alisdair> disterl :(
19:55 <alisdair> ask me about having to use postgres as a message bus because disterl sucks
19:55 s` joined
19:57 <tristan__> haha
20:05 meh`_ joined
20:05 imush joined
20:08 kblake_ joined
20:09 cschneid_ joined
20:11 cdg joined
20:13 kblake joined
20:13 ejpcmac joined
20:14 acscherp joined
20:18 ctp joined
20:19 wsieroci joined
20:19 junsuijin joined
20:26 griffinbyatt joined
20:26 <OliverMT> speaking of hashing an id to a node
20:26 <OliverMT> whats a good strategy for that?
20:26 <OliverMT> dividing up work between three nodes
20:27 <acscherp> hi; also asked on ecto slack, but maybe someone here knows the answer, getting an ecto error setting up a has_many relation: https://gist.github.com/arjan/fee1d758eef3aaca2456be7de439cc43
20:41 <micmus> OliverMT: I guess the simplest would be :erlang.phash2(id, number_of_nodes) - that works only for fixed membership
20:48 racycle joined
20:52 <codestorm> I'm getting this error on one of my machines:
20:52 <codestorm> 23:19:04.477 [error] SSL: :certify: ssl_handshake.erl:1609:Fatal error: certificate expired
20:52 <codestorm> {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:tls_alert, 'certificate expired'}}]}
20:52 <codestorm> Failed to fetch record for 'db_connection' from registry (using cache)
20:52 maxbeizer joined
20:52 <codestorm> and a few others for different packages
20:53 <ericmj> codestorm: i think someone is man-in-the-middling you
20:58 <alisdair> cafe wifi probably
20:59 <alisdair> OliverMT: rendezvous hashing
20:59 <alisdair> you hash the job id with each node id, then sort and pick the first or last or whatever
20:59 jkreeftmeijer joined
20:59 <alisdair> if you want to ensure decent distribution you should map multiple vnodes to a single real node tho
21:00 <alisdair> otherwise you can get skewed distributions and end up running everything on one node
21:00 <wwwd> I'm using an html select as per "https://hexdocs.pm/phoenix_html/Phoenix.HTML.Form.html#select/4". In bootstrap you can have a placeholder="pick one". I don't see any reference to this in the docs. Am I missing something or is this not allowed?
21:03 <codestorm> ericmj: thanks for the reply. That doesn't sound good. I'm at home, though, on a wired cable. My laptop on wifi isn't having this problem. I'll try wifi
21:04 <codestorm> oh, i was already on wifi, trying wired
21:05 <ericmj> codestorm: who is the certificate owner if you look at the certificate in your browser?
21:06 sfbw joined
21:08 <codestorm> how do I open it in the browser?
21:09 <ericmj> codestorm: https://repo.hex.pm
21:10 <codestorm> I get some XML with an access denied message
21:10 <ericmj> that means it's working
21:11 vmoravec joined
21:11 <ericmj> do you get that on the same machine where you get certificate expired message?
21:12 <codestorm> yes. sorry, i forgot to mention I'm running from docker
21:13 <ericmj> oh. so it could be a docker issue?
21:13 <mwbrown> maybe the base image you are using has out-of-date root certs?
21:13 asabil joined
21:13 <mwbrown> ca-certificates package out of date I mean
21:13 <mwbrown> or whatever flavor the distro has
21:15 akeating joined
21:15 stephen_m joined
21:15 <codestorm> that sounds reasonable, although the same docker images work on the laptop. in any case, it sounds like it's not specific to anything in the elixir ecosystem. The distro is ubuntu FWIW
21:18 <OliverMT> alisdair: micmus thx both
21:21 <OliverMT> phoenix.routes says aca_path GET /api/v1/aca/register Sow.AcaController :register_index
21:21 <OliverMT> but I am getting ** (UndefinedFunctionError) function Sow.AcaController.register_index/2 is undefined or private
21:22 <OliverMT> resp = get conn, aca_path(conn, :register_index)
21:22 <benwilson512> why not just `:register` ?
21:22 <benwilson512> keep in mind I know nothing about phoenix paths
21:22 <OliverMT> do I maybe need to use the as: thing in router.ex to be able to use the named one like that ?
21:23 <codestorm> thanks ericmj and mwbrown
21:23 <OliverMT> I dont think the url plays into the action name in the path helpers
21:23 <OliverMT> but, lets try
21:23 almielczarek joined
21:23 <mwbrown> codestorm: did you manage to get it working?
21:23 <codestorm> nope, not yet
21:23 <mwbrown> Is this a custom docker file or just the elixir official image?
21:24 <OliverMT> if I try to use register, it lists register_index as a target
21:24 <codestorm> it's a custom dockerfile running our phoenix project
21:24 <OliverMT> but register_index dont work
21:24 <mwbrown> codestorm: ok. Only thing I can suggest in that is to have RUN apt-get update && apt-get dist-upgrade as one of the first steps if you don't already have it
21:24 duane joined
21:24 cschneid_ joined
21:24 <mwbrown> if that's already in there and you are still getting cert errors, it's likely something else I think
21:26 griffinbyatt joined
21:28 <OliverMT> haha benwilson512
21:28 <OliverMT> turns out register_index action wasnt defined on controller
21:28 <OliverMT> that would do it
21:28 <benwilson512> :D
21:31 Havvy joined
21:32 akeating joined
21:38 <codestorm> mwbrown: i didn't have apt-get dist-upgrade, thanks for that tip. it didn't fix the issue, though
21:39 <mwbrown> interesting. I wonder if there is a way you can compare the cert that you are getting on the container vs. a cert from a regular web browser just to make sure it's the same
21:40 <mwbrown> Or.... maybe it's a caching issue. I just checked their cert and this one expires in December 2018 BUT it only became active yesterday
21:41 <mwbrown> SHA256 fingerprint is A4:E0:0D:38:3B:40:44:76:A2:99:81:5F:B9:2C:E8:1B:69:EB:0A:C7:40:EB:ED:2D:8E:2F:51:43:0B:45:DF:66
21:41 <codestorm> oh, interesting
21:42 josevalim_ joined
21:49 DeadTrickster joined
21:58 sfbw joined
22:01 ejpcmac left
22:01 jkreeftmeijer joined
22:03 <micmus> the "became active yerstarday" bit is interesting, what's the date inside the container? Maybe that's the issue - inside the container, the certificate is not yet valid.
22:07 sfbw joined
22:12 hahuang65 joined
22:22 cemilowski joined
22:24 josevalim joined
22:27 griffinbyatt joined
22:31 sjbao joined
22:35 kblake joined
22:37 rschmukler joined
22:37 kblake joined
22:41 Sgeo joined
22:42 strykerkkd joined
22:42 Sgeo joined
22:44 marcdel joined
22:46 kblake joined
22:48 kblake joined
23:02 <cemilowski> Hello. Is there any way to lock row for update, or via shared lock, using Ecto?
23:04 <cemilowski> OK. I've found this: http://donpflaster.net/2015/12/10/locking-records-with-elixirs-ecto-library/
23:05 <cemilowski> Another question: Is there anyway to make queries using specific indexes in Ecto?
23:18 sfbw joined
23:19 rschmukler joined
23:28 griffinbyatt joined
23:30 josevalim joined
23:33 potatosalad joined
23:41 sevenseacat joined
23:43 cschneid_ joined
23:48 kblake joined
23:52 nomicflux joined
23:55 Duckily joined