[Twisted-Python] Re: pretzel

Chris Armstrong carmstro at twistedmatrix.com
Fri Oct 5 08:55:55 EDT 2001

On Thu, Oct 04, 2001 at 09:23:46PM -0700, Kevin Turner wrote:
> What's the "if" clause in the features loop of BreadStick.sendMessage()
> supposed to be doing?  
> Why is the feature's method named "do" instead of "sendMessage"?  What's
> the difference between features and SaltGrains?

Ok, SaltGrains are things like "IRC Grain", "Words Grain" -- they're 
client interfaces to other services (not services themselves, to answer
your question directly below). "features" (I'd like a better name for
these) are things like "factoid engine", "fortune", etc. the reason for
that 'if' (I guess my comment wasn't clear enough) was so that features
could decide if they want the message to be distributed to the rest
of the networks or not. I'm not so sure this is needed now, as I originally
planned for private message passing to be a feature, but I built that into
the actual BreadStick/SaltGrain protocol (sendPrivMessage). So, who knows
what the future of 'features' holds. I'll have to think a little about it.

> What's the difference between a SaltGrain (or feature) and a
> pb^H^Hpassport.Service?  May saltGrain.network be the same as
> service.serviceName?  May person be a passport.Identity?
> Must message be a string?

Yeah, although it's not enforced or caught yet.

> See...  Pretzel puzzles me.  This project has some ideas with great
> potential, and it's precisely the sort of thing Twisted is good at...
> so I don't get why you seem to be intent on re-implementing Twisted
> inside of Twisted.  I guess that would make Pretzel live up to its name,
> but...

See my next comment.

> But establishing local services (SaltGrains) and passing messages
> between them...  That's what Twisted *does*, no need to create more
> infastructure there.

You're right. This is just a bit of glue code to hook a bunch of clients
together at once. Twisted doesn't have this yet; a centralized place where a
bunch of objects can send messages to and receive messages from other
objects. We don't need to use PB for this because there's no reason to
network the actual BreadStick/SaltGrains. The SaltGrains will handle their
own communications with other services, be it through a PB interface, an IRC
protocol, etc.

> Am I missing something?  I may just be speaking up too soon on a subject
> I know nothing about, but hey, that's what you get for checking it in to
> CVS.  ;)

I think the main confusion was your misunderstanding that SaltGrains are
similar to services -- remember, they're just *client* interfaces to other
services. A SaltGrain may represent a "ry" on some IRC network somewhere,
or a MUD, or...

Well, I've thought a little harder, and I guess I should clear something
else up. Technically, a SaltGrain could also be a server of some sort,
or a Resource on a web server, too. So, I guess SaltGrain should be
generally defined as "an agent who can transmit and/or receive data to/from
other users". But the general case will probably be some client agent
that connects to a remote server as a regular user to communicate with other
users on that service.

> "No, you're not going to trick me into writing IRC code *again*"-ly,

But-it's-so-much-fun!-ly yours,

Chris Armstrong  |  carmstro at twistedmatrix.com  |  cjast3 at robert-morris.edu
Web Page: http://purl.org/net/ChrisArmstrong

More information about the Twisted-Python mailing list