summaryrefslogblamecommitdiffstats
path: root/archives/extend/2013-January/000036.html
blob: 4a9db14cd250ed8e31a7c631aaf290db167dc876 (plain) (tree)















































































                                                                                                                                                                                                              
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
 <HEAD>
   <TITLE> [99s-extend] Cowboy, how call my database select function
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Cowboy%2C%20how%20call%20my%20database%20select%20function&In-Reply-To=%3C50ECA7C2.5030808%40oinksoft.com%3E">
   <META NAME="robots" CONTENT="index,nofollow">
   <style type="text/css">
       pre {
           white-space: pre-wrap;       /* css-2.1, curent FF, Opera, Safari */
           }
   </style>
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   <LINK REL="Previous"  HREF="000035.html">
   <LINK REL="Next"  HREF="000037.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[99s-extend] Cowboy, how call my database select function</H1>
    <B>Thomas Allen</B> 
    <A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Cowboy%2C%20how%20call%20my%20database%20select%20function&In-Reply-To=%3C50ECA7C2.5030808%40oinksoft.com%3E"
       TITLE="[99s-extend] Cowboy, how call my database select function">thomas at oinksoft.com
       </A><BR>
    <I>Wed Jan  9 00:12:02 CET 2013</I>
    <P><UL>
        <LI>Previous message: <A HREF="000035.html">[99s-extend] Cowboy, how call my database select function
</A></li>
        <LI>Next message: <A HREF="000037.html">[99s-extend] [ANN] Ranch 0.6.1
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#36">[ date ]</a>
              <a href="thread.html#36">[ thread ]</a>
              <a href="subject.html#36">[ subject ]</a>
              <a href="author.html#36">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>On 1/8/13 4:36 PM, &#1050;&#1086;&#1079;&#1083;&#1086;&#1074; &#1042;&#1103;&#1095;&#1077;&#1089;&#1083;&#1072;&#1074; wrote:
&gt;<i> I hope I could explain clearly.
</I>
This was not quite clear to me, but I'll do my best.

&gt;<i> Tell me how can I use this function in a Cowboy, in hendlers.
</I>
Well, you'd use it like any other Erlang function. If it's in a handler, 
you probably want to use init/3 or handle/2:

handle(Req, State) -&gt;
     _EredisScript = eredis_db:get_script(&quot;example&quot;, &quot;test&quot;),
     {ok, Resp} = cowboy_req:reply(200, Req),
     {ok, Resp, State}.

See other examples of implementing `cowboy_http_handler' behaviour in 
the Cowboy documentation and in the examples included with the library.

Thomas Allen

</PRE>

<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000035.html">[99s-extend] Cowboy, how call my database select function
</A></li>
	<LI>Next message: <A HREF="000037.html">[99s-extend] [ANN] Ranch 0.6.1
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#36">[ date ]</a>
              <a href="thread.html#36">[ thread ]</a>
              <a href="subject.html#36">[ subject ]</a>
              <a href="author.html#36">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend
mailing list</a><br>
</body></html>