Brian E Carpenter <brian.e.carpen...@gmail.com> wrote:
    > On 07-Aug-19 05:24, Michael Richardson wrote:
    >>
    >> I read draft-ietf-anima-grasp-api from the expired drafts list.

    > Right, the -03 draft expired while we were in Montreal. Our plan is to
    > make the next update after the two promised reviews arrive.

    >> I think that the event-loop architecture is different than a polling
    >> architecture.  I agree that given an event-loop architecture, that one
    >> can build a polled architecture, but the converse is not true.  The
    >> event-loop mechanism needs something to send events, while the polling
    >> system does not.

    > My understanding is limited, but the diagram at
    > https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/ seems
    > to say something different: the loop detects events by polling. (Yes,
    > OK, that's talking about Javascript but the fundamentals are the same,
    > surely?)

I see some of the confusion.
poll(2) is a poorly named system call (that replaces select(2)), which
retrieves the next event from the kernel.  It doesn't really poll :-)

I think that the important point is that:
1) you can't see events in the queue.
2) you can't ask of an action is done, only find out that it finished.

    >> I don't understand what the asa_nonce is for.

    > OK, then we need more text.

    >> Is this something that the underlying GRASP library is supposed to use
    >> internally to sort out which ASA is which?  Maybe this should be
    >> either a UUID, or an opaque type, which might in some cases, be a file
    >> handle, or contain one. (a la FILE *)

    > Yes, it should probably be opaque. In fact the documentation of the
    > concrete Python API says so: "Note - the ASA must store the asa_nonce
    > (an opaque Python object) and use it in every subsequent GRASP call."

Good, we agree.
The GRASP library should create and manage these handles.
Nonce is the wrong term and will be confused with the protocol and
cryptographic things; handle is a better term.

    >> 2.3.3 Discovery.  1) I would prefer to be able to ask for the list of
    >> cached locators for an objective directly.

    > OK, I can see that might be useful.

    >> 2) Rather than flush them explicitely (because there might be other
    >> ASAs depending upon them), I'd like to do a discovery that asks for
    >> objectives that are at at most X miliseconds old.  Flush is therefore
    >> X=0.

    > Hmm. I think we assumed you would only flush if you had reason to
    > believe they were stale. But certainly adding an age limit seems
    > reasonable.

The age limit means that I never explicitely flush, thus ASA-1 doesn't mess
with the cache for ASA-2.

    >> 3) In both threaded and event-loop situations, I'd like to be able
    >> have a function called when there are new answers, otherwise, I have
    >> to poll.

    > Right, that's a callback in event loop terminology. It's a matter of
    > preference; I have an aversion to side effects so I don't like
    > callbacks.  However, you're probably right that it should be an option.

In a threaded environment, I really want a thread per negotiation.
That means, on the server side (the side giving out resources), that I
need a thread per client, which means something has to spawn off these
threads.

    >> (And, if a function is called, then the question as to which thread
    >> does the calling is important; specifically one needs to know which
    >> other functions one call at that point answer may well be none. The
    >> answer depends upon how locking of structures is done. The answer is
    >> easier in event-loop version)

    > Yes; callbacks are a Bad Idea in a multithreaded version.

Not a bad idea, just an idea that must be clearly defined.

    >> listen_negotiate.  I think that this call is wrong in both threaded
    >> and event-loop use.  I think that in threaded version, I really want a
    >> new thread spawned off that does the right things (negotiate_wait,
    >> etc.),

    > You do need a new thread. But I don't have time right now to explain
    > how that works in my example use cases. And my explanation would be
    > Pythonesque.

So the API has to perhaps return something that says to the ASA, "new
negotiation here", rather than attempting to actually ever do anything.

--
]               Never tell me the odds!                 | ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works        |    IoT architect   [
]     m...@sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [


--
Michael Richardson <mcr+i...@sandelman.ca>, Sandelman Software Works
 -= IPv6 IoT consulting =-



Attachment: signature.asc
Description: PGP signature

_______________________________________________
Anima mailing list
Anima@ietf.org
https://www.ietf.org/mailman/listinfo/anima

Reply via email to