]> jfr.im git - irc.git/blob - software/!RELEASES/ircservices/achurch.org/services/lists/ircservices-coding/2003/002089.html
RELEASE -> !RELEASE
[irc.git] / software / !RELEASES / ircservices / achurch.org / services / lists / ircservices-coding / 2003 / 002089.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2 <HTML>
3 <HEAD>
4 <TITLE> [IRCServices Coding] get_nickinfo like functions suggestion
5 </TITLE>
6 <LINK REL="Index" HREF="index.html" >
7 <LINK REL="made" HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20get_nickinfo%20like%20functions%20suggestion&In-Reply-To=oprrakowbo3wwnu9%40mail-hub.optonline.net">
8 <META NAME="robots" CONTENT="index,nofollow">
9 <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
10 <LINK REL="Previous" HREF="002088.html">
11 <LINK REL="Next" HREF="002093.html">
12 </HEAD>
13 <BODY BGCOLOR="#ffffff">
14 <H1>[IRCServices Coding] get_nickinfo like functions suggestion</H1>
15 <B>Andrew Church</B>
16 <A HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20get_nickinfo%20like%20functions%20suggestion&In-Reply-To=oprrakowbo3wwnu9%40mail-hub.optonline.net"
17 TITLE="[IRCServices Coding] get_nickinfo like functions suggestion">achurch at achurch.org
18 </A><BR>
19 <I>Wed Jun 25 10:35:53 PDT 2003</I>
20 <P><UL>
21 <LI>Previous message: <A HREF="002088.html">[IRCServices Coding] get_nickinfo like functions suggestion
22 </A></li>
23 <LI>Next message: <A HREF="002093.html">[IRCServices Coding] get_nickinfo like functions suggestion
24 </A></li>
25 <LI> <B>Messages sorted by:</B>
26 <a href="date.html#2089">[ date ]</a>
27 <a href="thread.html#2089">[ thread ]</a>
28 <a href="subject.html#2089">[ subject ]</a>
29 <a href="author.html#2089">[ author ]</a>
30 </LI>
31 </UL>
32 <HR>
33 <!--beginarticle-->
34 <PRE> Easy counterexample: /os akill add luser@*.example.com (where it
35 would definitely _not_ be proper to use out-of-date data)
36
37 --Andrew Church
38 <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">achurch at achurch.org</A>
39 <A HREF="http://achurch.org/">http://achurch.org/</A>
40
41 &gt;<i>
42 </I>&gt;<i>After discussing mysql module design it occurred to me that it would make
43 </I>&gt;<i>designing a
44 </I>&gt;<i>caching database module for mysql much easier if the get_ functions had
45 </I>&gt;<i>analogs for
46 </I>&gt;<i>read-only use.
47 </I>&gt;<i>
48 </I>&gt;<i>I figure that if we create functions like get_readonly_nickinfo, it would
49 </I>&gt;<i>allow
50 </I>&gt;<i>for more efficient caching of data. The reasoning behind this is that
51 </I>&gt;<i>procedures
52 </I>&gt;<i>which modify a nick/channel/nickgroup need to have a more updated version
53 </I>&gt;<i>of the
54 </I>&gt;<i>data in order to figure out whether it can be modified the way it wants to.
55 </I>&gt;<i>
56 </I>&gt;<i>On the other hand, many functions that only read from these pieces of data
57 </I>&gt;<i>would not have to have the most recent version and could use the cached
58 </I>&gt;<i>version
59 </I>&gt;<i>since it would cause little harm to simply display out-of-date information
60 </I>&gt;<i>to the user.
61 </I>&gt;<i>
62 </I>&gt;<i>If we cached all pieces of data (including read-write), then it would
63 </I>&gt;<i>happen
64 </I>&gt;<i>that either the data in the database would be locked for too long and no
65 </I>&gt;<i>outside
66 </I>&gt;<i>program could ever modify it, or if we didn't lock the entries in the
67 </I>&gt;<i>database,
68 </I>&gt;<i>we would end up overwriting any changes another program made once we
69 </I>&gt;<i>invalidated
70 </I>&gt;<i>the cache.
71 </I>&gt;<i>
72 </I>&gt;<i>So basically I propose creating database functions using names like
73 </I>&gt;<i>get_readonly_nickinfo
74 </I>&gt;<i>or get_readonly_chaninfo, which would be used by commands such as INFO,
75 </I>&gt;<i>ACCESS LIST,
76 </I>&gt;<i>AKICK LIST, AKILL LIST, and for determining access etc. The regular
77 </I>&gt;<i>get_nickinfo etc
78 </I>&gt;<i>functions would retain the same functionality for backwards compatibility
79 </I>&gt;<i>and nothing
80 </I>&gt;<i>would break.
81 </I>&gt;<i>
82 </I>&gt;<i>These new get_readonly_* (or if you want, get_cache_*) would be implemented
83 </I>&gt;<i>in modules
84 </I>&gt;<i>that cache nick information in memory. In modules where either a)
85 </I>&gt;<i>information is ALWAYS
86 </I>&gt;<i>read from database on get_* or b) all information is always in memory, they
87 </I>&gt;<i>would be
88 </I>&gt;<i>synonyms for the regular get_* functions (i.e. in version4, they would be
89 </I>&gt;<i>synonyms).
90 </I>&gt;<i>
91 </I>&gt;<i>The info returned by these functions would generally not be modified (save
92 </I>&gt;<i>for things
93 </I>&gt;<i>that aren't saved to database such as the locked field) and wouldn't be
94 </I>&gt;<i>passed to
95 </I>&gt;<i>put_* functions. Also, it would be a bad idea to use the info returned from
96 </I>&gt;<i>the
97 </I>&gt;<i>readonly/cache functions to conditionally modify other data (example, you
98 </I>&gt;<i>wouldn't
99 </I>&gt;<i>use these functions to check someone's access so that they could change
100 </I>&gt;<i>channel options,
101 </I>&gt;<i>since another program could recently have removed them from the access list
102 </I>&gt;<i>without
103 </I>&gt;<i>us knowing it. It would be safe however to check someone's access to join
104 </I>&gt;<i>the channel,
105 </I>&gt;<i>use INVITE UNBAN OP etc, because that doesn't involve changing the
106 </I>&gt;<i>ChannelInfo).
107 </I>&gt;<i>
108 </I>&gt;<i>If I seem to be spouting gibberish, by all means ask me to clarify.
109 </I>&gt;<i>------------------------------------------------------------------
110 </I>&gt;<i>To unsubscribe or change your subscription options, visit:
111 </I>&gt;<i><A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">http://www.ircservices.za.net/mailman/listinfo/ircservices-coding</A>
112 </I></PRE>
113
114 <!--endarticle-->
115 <HR>
116 <P><UL>
117 <!--threads-->
118 <LI>Previous message: <A HREF="002088.html">[IRCServices Coding] get_nickinfo like functions suggestion
119 </A></li>
120 <LI>Next message: <A HREF="002093.html">[IRCServices Coding] get_nickinfo like functions suggestion
121 </A></li>
122 <LI> <B>Messages sorted by:</B>
123 <a href="date.html#2089">[ date ]</a>
124 <a href="thread.html#2089">[ thread ]</a>
125 <a href="subject.html#2089">[ subject ]</a>
126 <a href="author.html#2089">[ author ]</a>
127 </LI>
128 </UL>
129
130 </body></html>