jayjaybillings / fire

Repository for the Fire framework
Other
0 stars 2 forks source link

Add HTTP networking tool #17

Open amccaskey opened 7 years ago

amccaskey commented 7 years ago

We need a tool that lets us execute HTTP GET and POST commands. We need this for real-time updates from simulations to ICE. We also need this for XACC Rigetti QPU support.

amccaskey commented 7 years ago

I'm gonna do something similar to what I've done before - an INetworkingTool interface with get and post methods, and an AsioNetworkingTool implementation that uses boost asio which is header-only.

amccaskey commented 7 years ago

https://github.com/amccaskey/networkingtool

jayjaybillings commented 7 years ago

If you want, I'm fine with just starting with your networking tool code. I always thought it was nice code. (I'll give it a peek again though in case I see anything to complain about. ;-))

jayjaybillings commented 7 years ago

The only things that I immediately noticed with that code that are problematic are: 1) It uses some MOOSE-specific stuff. 2) It sits in the std namespace.

2 brings up an important point. Where would this sit in Fire? I would say we need to go ahead and create a util module and sub-namespace so that we have fire::util::INetworkingTool, for example. What do you think?

amccaskey commented 7 years ago

I just made that repo so that I could save the files - I found them on my hard drive and didn't want to lose them or dig through MOOSE' commit logs

I'm going to overhaul them and put them in Fire.

amccaskey commented 7 years ago

I was going to make an http directory, or util works too.

amccaskey commented 7 years ago

It will be in the fire namespace. moose didn't use namespaces :/

jayjaybillings commented 7 years ago

Yeah, let's make it util instead of http. We might do more than http in there.

I guess we could say MOOSE is free-range? Har har.

jayjaybillings commented 7 years ago

Joking aside, what do you think about putting it in a fire::util namespace instead of the main fire namespace?

amccaskey commented 7 years ago

I'm cool with that

Does that mean you want it to be fire::tensor::Tensor instead of fire::Tensor

Same for other directories?

jayjaybillings commented 7 years ago

No, some of the directories can't do that because of their templates and design. Explicit instantiation requires being in the same namespace for example.

So that's where I've kind of been drawing the line: things in Fire that people will extend, implement or specialize should be in the fire namespace. Specific, concrete, or final things should go in their own.

jm2c. Happy to reconsider.

jayjaybillings commented 7 years ago

Specifically in the case of fire::Tensor, I think it is fine.

amccaskey commented 7 years ago

I wrote a lot of this code last night.

New question: Any good suggestions on how to test it?

First thought was boost python to kick off a python http server that listens for posts.

jayjaybillings commented 7 years ago

That's a good option. I was going to suggest Mongoose instead, but it is released under the GPLv2 and I don't want to risk license pollution, even if they are only tests. Here's an interesting one though that is built on Asio:

https://github.com/eidheim/Simple-Web-Server

Jay Jay Billings Team Lead, Scientific Software Development Oak Ridge National Laboratory Twitter Handle: @jayjaybillings


From: Alex McCaskey notifications@github.com Sent: Friday, May 26, 2017 9:33 AM To: jayjaybillings/fire Cc: Billings, Jay Jay; Comment Subject: Re: [jayjaybillings/fire] Add HTTP networking tool (#17)

I wrote a lot of this code last night.

New question: Any good suggestions on how to test it?

First thought was boost python to kick off a python http server that listens for posts.

- You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jayjaybillings/fire/issues/17#issuecomment-304283655, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGFVYWQ1DN-97KdbDzoCf26fFjnSvidYks5r9tTEgaJpZM4Nm4Ta.

amccaskey commented 7 years ago

Cool, that looks awesome. I'll use that.